ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'system.sysuser', bu

问题:
已经在settings.py文件中注册过app仍旧提示没有安装,并且使用makegirations命令时会抛出如下异常。

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

解决办法:
找到自己的python3.x,进入site-packages/django/contrib/admin/migrations文件目录下,除了__init__.py文件,其他的全部删除。(注意,切勿把__init__.py文件删了,也不要把contrib/contenttypes这个文件夹下的migrations删了,不然会导致migrate功能失效,就只能把django卸了重下)。
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'system.sysuser', bu_第1张图片
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'system.sysuser', bu_第2张图片

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'system.sysuser', bu_第3张图片

文章参考:
https://blog.csdn.net/github_38854366/article/details/81015647

你可能感兴趣的:(django)