数据迁移的错误

创建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卸了重下)。

猜你喜欢

转载自www.cnblogs.com/demiao/p/11884940.html