创建Django写完models数据迁移时报错

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'app01.userinfo',
but app 'app01' isn't installed.
数据迁移的错误

解决办法:
找到自己的python3.x,进入site-packages/django/contrib/admin/migrations文件目录下,除了__init__.py文件,其他的全部删除。(注意,切勿把__init__.py文件删了,也不要把contrib/contenttypes这个文件夹下的migrations删了,不然会导致migrate功能失效,就只能把django卸了重下)。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2022-02-05
猜你喜欢
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
相关资源
相似解决方案