South
Category: /knowledge /djangoTags: django
Basic usage
Fresh install —————– python manage.py syncdb –all python manage.py migrate –fake
Upgrade
python manage.py syncdb --all
python manage.py migrate --fake
-
instead of
manage.py syncdb
, runmanage.py schemamigration --initial $app_name
-
Run the migration using
manage.py migrate
-
Whenever data models.py changes, to create a new migration file,
manage.py schemamigration --auto $app_name
next to apply the new changes.
manage.py migrate $app_name
For existing projects
manage.py convert_to_south $app_name
manage.py schemamigration --auto $app_name
manage.py migrate $app_name
Installation
pip install South
Then, add south
to the list of INSTALLED_APPS in your settings.py
.