Django South error with initial migration

别等时光非礼了梦想. 提交于 2019-11-28 18:54:06
Matthew Rankin

Ken Cochrane's answer to the StackOverflow question How Come My South Migrations Doesn't Work for Django held the key.

For a new Django project and app, I had to perform the following steps:

  1. Add South to INSTALLED_APPS in settings.py, but do not add your apps
  2. Run syncdb to add the Django and South tables to the database. South modifies syncdb, so it's important to have South in your INSTALLED_APPS.
  3. Add apps to INSTALLED_APPS in settings.py
  4. Run python manage.py schemamigration app_name --initial for each app
  5. Run python manage.py migrate app_name

Read the instructions—No, all of the instructions

I was so excited to start using South that I skipped reading the installation documentation. I simply installed South using pip install south and then just added it to my INSTALLED_APPS. That was my mistake.

The Configuring Your Django Installation section of the installation documentation states:

Once South is added in, you’ll need to run ./manage.py syncdb to make the South migration-tracking tables (South doesn’t use migrations for its own models, for various reasons).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!