我刚刚开始从事使用Django的其他人的项目。
运行此序列后:
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 127.0.0.1:8000
我收到错误:
django.db.migrations.exceptions.NodeNotFoundError:
Migration structures.0002_auto_20171121_1034 dependencies reference nonexistent parent node ('structures', '0001_initial')
migrations
文件夹包含0002_auto_20171121_1034.py
,0003_auto_xxxxxxxx_xxxx.py
,0004_auto_xxxxxxxx_xxxx.py
,0005_auto_xxxxxxxx_xxxx.py
,0006_auto_xxxxxxxx_xxxx.py
,0007_auto_xxxxxxxx_xxxx.py
。
但是它不包含0001_initial.py
。
我尝试过的事情:
[1)我试图删除.pyc
文件夹的所有migrations
文件。
2)我试图删除这三行:
dependencies = [
('structures', '0001_initial'),
]
包含在0002_auto_20171121_1034.py
中,但是这次,我得到了这个错误:
You have 6 unapplied migration(s). Your project may not work properly until you apply the migrations
for app(s): structures.
Run 'python manage.py migrate' to apply them.
有没有人可以帮助您?
它可能随着添加或删除模型字段而上升。尝试上面的答案。
它可能随着添加或删除模型字段而上升。尝试上面的答案。