Things I’ve learnt in the last 2 weeks

I know django fu

Raindrops on roses and whiskers on kittens
Bright copper kettles and warm woolen mittens
Brown paper packages tied up with strings
These are a few of my favorite things

– Favourite Things, Maria

Here are some cool stuff I’ve learnt in the last couple of weeks:

  1. South: For those new to Django, one of your grievances might be the difficulty in changing the database schema. This is especially true if you’re not sure what the end product looks like. For example, if you were to change your models class definitions either by adding a column or changing the field type, syncdb will not pick this up. The workaround is to drop your table (and all the data) and run syncdb again. That sucks, enter South. What South does is that it first creates a schema of your changes and then applies it. Once you’ve set it up, it’s as simple as creating a schema like this: ./ schemamigration <app_name> –auto and then applying it like this ./ migrate <app_name>. Here is the tutorial link.
  2. Unit tests: Unit tests form the backbone of TDD. The idea is that you write a test to achieve a desired outcome before coding it. Django’s testing module is very similar to Python. You can read more about it here. Here are some useful links I found about Unit testing in Django.
  3. Git: I’ve been using Git for about 3 weeks now. I think I’ve got the basics nailed down and managed to merge a few conflicts as well. Here are some useful links and tools for you Git users
    1. – to EASILY solve conflicts. sudo apt-get install kdiff3.  Launches with git mergetool
    2. – a visualisation of git log. It also allows you to easily retrieve old documents in the git repository. sudo apt-get install qgit. Launches with qgit
    3. – a cheatsheet with all the important commands

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s