Why don't my south migrations work?

后端 未结 6 1579
长情又很酷
长情又很酷 2020-12-04 04:48

First, I create my database.

create database mydb;

I add \"south\" to installed Apps. Then, I go to this tutorial: http://south.aeracode.

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 05:15

    The tutorial you're using states:

    (If this fails complaining that south_migrationhistory does not exist, you forgot to run syncdb after you installed South.)

    Assuming that your post accurately details the steps you've taken, following that link seems to show that you missed a step before setting up your new app. As you are following a tutorial for setting up migrations on a new application, the order is:

    1. Add south to INSTALLED_APPS.
    2. Run syncdb.
    3. Then follow the tutorial.

    I.e., you should've already run syncdb before you added in the models for your new app. Your solution of removing your app from INSTALLED_APPS should work, but it's worth noting that it's really only a "silly" work-around, as you missed a step earlier on. Had syncdb been run before you created the models for that app, you wouldn't have to use the work-around.

提交回复
热议问题