Need A Cheatsheet For Django-South?
November 07, 2010
One of the greatest things about Django is it’s emphasis on apps and reusability and the community that follows it. My Django projects always have apps in them, and one of my most recent favorites is Django-South. The problem is that South is one of those apps that I often use once when I setup my project and then don’t touch for a while (outsite of migrations updates). So to help myself out–and hopefully others as well–I have composed a table of the commands that I use most often in South
Command | Description |
---|---|
./manage.py schemamigration app\_name –initial | If you have not previously run you app through syncdb use this command to set it up with [South](http://south.aeracode.org/). |
./manage.py convert\_to\_south app\_name | Use you already ran your app through syncdb. |
./manage.py migrate app\_name –fake | Use this if your like me and often use --initial when I should have used the convert\_to\_south command. This tells South that your database is already setup for the current schema. |
./manage.py migrate | Migrate the database schema for all the South enabled apps. |
./manage.py migrate app\_name | Migrate only the specified app’s database schema |
./manage.py schemamigration app\_name –auto | Update the schema migration for the app. |
These are the commands that you will need the most, but of course South is a very well done app and you should check out the South documentation for more advanced options.