当前位置 : 主页 > 编程语言 > python >

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'app01.user', but ap

来源:互联网 收集:自由互联 发布时间:2022-06-15
执行python manage.py migrate命令时报错: ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'app01.user', but app 'app01' isn't installed. 已经在settings.py中安装app01,但还是报错; 解决方法

执行python manage.py migrate命令时报错:

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'app01.user', but app 'app01' isn't installed.

已经在settings.py中安装app01,但还是报错;

解决方法:找到自己的/python3X/lib/site-packages/django/contrib/admin/migrations文件夹,把里面除了__init__.py的所有文件,全部删了再migrate就可以了。(注意,切勿把__init__.py文件删了,也不要把contrib/contenttypes这个文件夹下的migrations删了,不然会导致migrate功能失效,像我就只能把django卸了重下)

ValueError: The field admin.LogEntry.user was declared with a lazy reference to

————————————————

原文链接:https://blog.csdn.net/github_38854366/article/details/81015647

网友评论