Django 1.7 - makemigrations not detecting changes

前端 未结 29 1448
忘了有多久
忘了有多久 2020-11-27 12:43

As the title says, I can\'t seem to get migrations working.

The app was originally under 1.6, so I understand that migrations won\'t be there initially, and indeed i

29条回答
  •  死守一世寂寞
    2020-11-27 13:02

    If you're changing over from an existing app you made in django 1.6, then you need to do one pre-step (as I found out) listed in the documentation:

    python manage.py makemigrations your_app_label

    The documentation does not make it obvious that you need to add the app label to the command, as the first thing it tells you to do is python manage.py makemigrations which will fail. The initial migration is done when you create your app in version 1.7, but if you came from 1.6 it wouldn't have been carried out. See the 'Adding migration to apps' in the documentation for more details.

提交回复
热议问题