When writing tests in Django apps, I have an urge to reuse code in setUp() across all tests (most of my apps use the same setUp). So I come up with a GlobalSetup class that other tests should inherit from (it’s located at the project level). However, this approach creates a problem with loading fixtures. According to Django docs:
Hey there! This is my new blog powered by Octropress and hosted on Github. Octopress was exactly what I was looking for in a blog engine (Yes, code snippets should be built out of the box in a blog). I’ve had Blogger previously but ever since I switched it to the new theme, all my github gists were not able to display. So I abandoned it. I might migrate the posts from Blogger here, however I’ll mainly focus on writing about Python and Django in this one. That’s about it, stay tuned for the next post. :wq
Having played with Capistrano before, I suddenly had an urge to find its Pythonic alternative. After few google searches, I stumbled upon Fabric. It’s basically a “python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks”. Spent few minutes trying to write functions to deploy Django applications to my Linux server and I have to say, Fabric’s API is really easy to use, very customizable (it’s as easy as wrapping up your shell commands in a python function) and more importantly it has Django integration which I’m gonna need the most. Having said all these, here’s the video demo I recorded while messing around with Fabric, enjoy:
P/S: django-nose, nosegrowl2 and tdaemon were used in order to show notification of testing results (just FYI)
If you have the following error after uploading your WordPress, and re-uploading
category-template.php didn’t work, you could try pasting this function at the of the file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
I’ve just registered an account on Google Storage last month and I totally love it as. I particularly like gsutil since I’m most of my time on Terminal. Here are two aliases I use with gsutil in my
.bash_profile. Of course, remember to replace your bucket name
1 2 3 4 5 6 7
Here is how you can store git command output in a good manner after which you will be able to easily retrieve necessary information. This snippet belongs to the project I’m currently working on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Finally got time to continue developing Push Contacts. I’ve gotten a nerve-wrecking problem while developing with C2DM applications. When the app supposed to get the push message, it didn’t respond to it. Looking at the logs I encountered an error stack related to GTalk (with TalkProvider tag). Decided to google the problem and the solution was to sign out of GTalk on the phone.
Got Gnome desktop installed on TonidoPlug but when trying to vnc to it I realised the keyboard layout is messed up. This is how you fix it:
- Kill existing vnc session:
vncserver -kill :1(1 here is the pid)
- Edit with:
- Add this line:
- Restart vncserver
Yes, TonidoPlug is a new toy that I’ve gotten last week. It is a basically a plug computer that can act likea home server. The hardware specs are the same as SheevaPlug with 1.2GHz ARM and 512MB RAM and 512MB Flash. The best thing about it is the energy consumption ranging from 5-10 Watts.
It’s been a while since I last posted an entry. Nothing much has changed in my life. The two-week holiday has just passed by in a blink of an eye. Has been busy with Android assignment, Cypher IGs camp and Pycon Singapore 2010. Now after Pycon, I’m pretty much convinced about the power of simplicity of Python. Knowing Google App Engine (GAE) quite a while ago, I decided to use GAE to help me out in my assignment (yes, yes, Google to the rescue) by writing a simple GAE web service which stores/retrieves feedbacks in form of JSON. The following tutorial is simple enough for beginners to follow.