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.
  • 1
  • 2

解決辦法:
找到自己的python3.x,進入site-packages/django/contrib/admin/migrations文件目錄下,除了__init__.py文件,其他的全部刪除。(注意,切勿把__init__.py文件刪了,也不要把contrib/contenttypes這個文件夾下的migrations刪了,不然會導致migrate功能失效,就只能把django卸了重下)。
在這里插入圖片描述
在這里插入圖片描述

在這里插入圖片描述

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

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM