关于Django项目启动报错RuntimeError: Model class wechat.models.UserInfo doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

写了一个django的项目,运行时出现如下错误: RuntimeError: Model class wechat.models.UserInfo doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.. 但之前这个model都没有改变过,网上查了半天没有结果 然后我将相应的UserInfo的引入行都删除,然后就正常了 ,分析可能是因为重复引入导致某些检查失败

方法二:在django的settings中的INSTALLED_APPS处添加'django.contrib.sites'进行app注册,并设置SITE_ID值。

猜你喜欢

转载自www.cnblogs.com/weidaijie/p/12409957.html