
These are some wind turbines powering an Antarctic Research Station. And that’s also about as South as you can get in your quest for renewable energy. But today we’re writing about migrating your databases South! Or the following scenario:
You create an übercool insightful Django model. You put some data on it, make some templates, … looks good! And then you realize it wasn’t as cool as you thought. You forgot to add … say the minimum operating temperature for your wind turbines. Bummer! Enter South ( intelligent schema and data migration).
manage.py schemamigration app_name --initial
if you have not done syncdb yet:
manage.py migrate app_name
if you have already done syncdb:
manage.py migrate app_name --fake
Then edit your models.py and add all the fields you forgot to add,
Then create the new migration file and finally migrate the database:
manage.py schemamigration app_name --auto
manage.py migrate app_name
see also [djangopro] for a good explanation.
Also to check the migrations you have done so far simply run:
manage.py migrate --list
INSTALLATION:
Go to /etc/apt/sources.list, for example:
$ sudo emacs -nw /etc/apt/sources.list
and add this at the bottom:
## added for Scrapy ##deb http://archive.scrapy.org/ubuntu natty main
where you substitute natty with whatever your release is, and therefore with whatever the output of:
$ lsb_release -cs
Update and install,
$ sudo apt-get update$ sudo apt-get install scrapy-0.15
and off you go!
I’ve found quite a few useful cheat sheets for the web which I’ll share with you all.
More below the fold, …

<HTML5>
I know, I know … no html5 goodness in django. But you can start using it anyway.

<CSS3>

<Django>
and reference sheets,

<GIT>
and to keep things tidy and version-controlled …
Now go, print them all in A3 or bigger, use them as wall-paper in your room and keep coding away. For more cheat sheets see http://devcheatsheet.com/