Sunday 20 March 2011

Starting a new DJango CMS application, using South

This is actually very simple. Firstly, make sure that 'south' is listed in your INSTALLED_APPS. Next, simply give the following commands:
python manage.py syncdb --all
This will create all the tables required by the installed applications, as per the old method.
python manage.py migrate --fake
This will populate the south_migrationhistory table with migration info for all applications where South is setup. Finally, you can confirm the status of your application:
python manage.py syncdb
Syncing...
No fixtures found.

Synced:
+ django.contrib.admin
+ django.contrib.contenttypes
+ django.contrib.sessions
+ django.contrib.sitemaps
+ django.contrib.sites
+ mptt
+ publisher
+ sorl.thumbnail
+ sekizai

Not synced (use migrations):
- django.contrib.auth
- cms
- cms.plugins.text
- cms.plugins.picture
- cms.plugins.link
- cms.plugins.file
- cms.plugins.snippet
- menus
- south
(use ./manage.py migrate to migrate these)
You can also check what South migrations have been installed via the following:
python manage.py migrate --list
Thanks to Martin for his assistance with this.

No comments:

Post a Comment