执行python manage.py makemigrations时出现以下错误

D:\autotestplat>python manage.py makemigrations
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, **options)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\commands\makemigrations.py", line 78, in handle
loader = MigrationLoader(None, ignore_no_migrations=True)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
self.build_graph()
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 267, in build_graph
raise exc
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 241, in build_graph
self.graph.validate_consistency()
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\graph.py", line 243, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\graph.py", line 243, in <listcomp>
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\graph.py", line 96, in raise_error
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration apitest.0001_initial dependencies reference nonexistent parent node ('product', '0001_initial')

问题原因:由于'product' 应用下的'0001_initial'文件不存在,而在 apitest应用下的0001_initial 文件中引用了product中的迁移记录

问题解决:删除 apitest->migrations下的0001_initial .py文件,再重新执行命令

最新文章

  1. iOS 保持界面流畅的技巧 (转载)
  2. JavaScript作用域链
  3. table sorting&ndash;angularjs
  4. Asp.net MVC验证哪些事(3)-- Remote验证及其改进(附源码)
  5. Python基础8- 序列
  6. NSCalenda日历类
  7. Python操作Excel
  8. 【php学习】图片操作
  9. 不区分大小写的in_array实现 thinkphp框架
  10. laravel5验证码
  11. Less2css error 终极解决方案
  12. AAA游戏中雪的实现
  13. mysql 显示表字段及mysql系统信息
  14. go语言简述
  15. mysql5.7 linux安装参考
  16. 初次学习AngularJS
  17. netbeans等宽字体却不支持中文
  18. Floyd算法 - 最短路径
  19. Spark JavaRDD、JavaPairRDD、Dataset之间的相互转换
  20. [PowerShell]get data from Ini File

热门文章

  1. InnoDB关于事务、锁、MVCC专题
  2. 【YOLOv5】LabVIEW+YOLOv5快速实现实时物体识别(Object Detection)含源码
  3. 「JOISC 2022 Day1」京都观光 题解
  4. Flink WordCount入门
  5. MyBatis的各种查询功能
  6. 成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
  7. JMETER与它的组件们
  8. RDF/RDFS/OWL
  9. 带你了解NLP的词嵌入
  10. Codeforces Round #817 (Div. 4)