South

Category: /knowledge /django
Tags: 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
  1. instead of manage.py syncdb, run

     manage.py schemamigration --initial $app_name
    
  2. Run the migration using manage.py migrate

  3. 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.

Resources

评论

提示

  • 如果看不到评论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)