报错RuntimeError: Model class apps.user.models.User doesn't declare an explicit app_label and isn&
【报错RuntimeError: Model class apps.user.models.User doesn'
t declare an explicit app_label and isn&】赋料扬雄敌,诗看子建亲。这篇文章主要讲述报错RuntimeError: Model class apps.user.models.User doesn'
t declare an explicit app_label and isn&相关的知识,希望能为你提供帮助。
运行环境
PyCharm 2017.1
Django 2.0.1
python 3.6.1使用相对路径引用Models模块
from .models import *
1
在同时存在多个apps的情况下,有机会报错RuntimeError: Model class app_anme.models.Ad doesn'
t declare an explicit app_label and isn'
t in an application in INSTALLED_APPS.
1
解决办法
使用绝对路径引用 以后不能采用点的方式了from app_name.models import *
————————————————
推荐阅读
- Java深入学习03(happens-before规则)
- Android开机自启动应用
- Android001 开发环境安装(详细)
- 浅谈物联网操作系统选择,浏览器比安卓更合适!
- Android中三种创建监听器的方法
- android常用控件和布局
- [Trouble shooting] Alt-A shortcut taken by another app and conflict with Emacs' M-a
- Android Activity间跳转与传递数据
- flume 启动agent报No appenders could be found for logger的解决