0
点赞
收藏
分享

微信扫一扫

NodeNotFoundError(self.error_message, self.key, origin=self.origin) django.db.migrations.excep

报错代码:

raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration jobs.0001_initial dependencies reference nonexistent parent node ('auth', '0012_alter_user_first_name_max_length')

下面是解决方案

第一步 ,卸载Django,pip uninstall Django
第二步,此时/Lib/site-packages包里面还有残余的Django文件夹,删除它
第三步,删除项目中所有 pycache 文件夹,删除 migrations 下的文件保留 init .py.
第三步,重新安装对应版本的Django,否则有些会不兼容,
第四,执行迁移,成功!



举报
0 条评论