【发布时间】:2014-12-29 18:31:41
【问题描述】:
我正在尝试从 Django 1.6.7 升级到 Django 1.7.1,所以我一直在尝试迁移我的应用程序。
我关注了django docs here。
我从已安装的应用程序中删除了南。
在迁移目录中,我删除了编号的迁移文件和 .pyc 文件,但我保留了目录和 __init__.py 文件。
然后我运行:
python manage.py makemigrations your_app_name
我收到以下确认消息:
Migrations for 'your_app_name':
0001_initial.py:
- Create model UserProfile
接下来我运行:
python manage.py migrate your_app_name
我收到以下错误:
CommandError: App 'your_app_name' does not have migrations (you cannot selectively sync unmigrated apps)
根据文档,我也跑了:
python manage.py migrate --fake your_app_name
我收到了同样的错误信息:
CommandError: App 'your_app_name' does not have migrations (you cannot selectively sync unmigrated apps)
谁能解释一下为什么这对我不起作用?
【问题讨论】:
-
makemigrations是否在您的migrations文件夹中创建了新文件? -
是的。新文件名为 0001_initial
标签: python django upgrade django-migrations