django:doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
启动django 时,报错如下:
RuntimeError: Model class app.model.User.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
需要在 settings.py 中的INSTALLED_APPS 添加 app包名称
解决方案:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
"app",
]
示意图
正文到此结束
相关文章
热门推荐
评论插件初始化中...