问题:RuntimeError: Model class LuffyAPI.apps.user.models.UserInfo doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
问题截图

报错原因
提示app未注册,但实际上已经注册的
1.
# settings配置文件移动后要将这个settings添加到环境变量中
sys.path.insert(0, BASE_DIR)
# 将所有app目录的根加入到环境变量中,后续无需更改app的引入方式
sys.path.insert(1, os.path.join(BASE_DIR, 'apps'))
# 将app注册形式写成这样
'user.apps.UserConfig',
2.
# 路由层和视图层,导入要用相对导入,不能用绝对导入
# 错误
from LuffyAPI.apps.user import views
# 正确
from . import views
问题:RuntimeError: Model class LuffyAPI.apps.user.models.UserInfo doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.的更多相关文章
- RuntimeError: Model class apps.users.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
报错代码: File "/home/bsodgm/Desktop/Django_projection/mall/apps/users/views.py", line 9, in & ...
- Model class apps.goods.models.GoodsType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
在admin.py注册这个model时,报了个错: RuntimeError: Model class apps.goods.models.GoodsType doesn't declare an e ...
- 在views中引用UserProfile报错RuntimeError: Model class apps.users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
如图报错,在settings中,该加的也加了啊! 显然类似于网上最容易遇到的解决方案如下图,是没有任何意义的 只要在view中有 from .models import UserProfile,Ver ...
- RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Django启动的时候报错 File "/home/hehecat/PycharmProjects/MxShop/MxShop/urls.py", line 23, in from ...
- RuntimeError: Model class user.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Django 2.x版本迁移数据库报这个错误,user表使用的Django的验证系统 本来就想改一下用户表的表名,莫名的报了个这个错误,在网上找到了解决办法 打开user应用模块下的apps.py文件 ...
- Django RuntimeError: Model class app_anme.models.Ad doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.报错
报错内容 RuntimeError: Model class app_anme.models.Ad doesn't declare an explicit app_label and isn't in ...
- RuntimeError: Model class app_anme.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.---python学习错误记录
untimeError: Model class app_anme.models.User doesn't declare an explicit app_label and isn't in an ...
- Django开发BUG "Model class WH_auth.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS."
当进行数据库迁移的时候发生问题,报错如下:RuntimeError: Model class WH_auth.models.User doesn't declare an explicit app_l ...
- RuntimeError: Model class myapp.models.Test doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
没有添加子应用在settings里面!
- Django开发学习BUG记录--RemovedInDjango19Warning:Model class apps.user.models.User doesn't declare an explicit app_label
报错信息: /home/python/PycharmProjects/dailyfresh/apps/user/models.py:8: RemovedInDjango19Warning: Model ...
随机推荐
- [转帖]GCC 编译及编译选项
俗话说:'工欲善其事,必先利其器',一直在工作中使用GNU C编译器(以下简称GCC),这里对GCC的一些警告选项细致的分析,并列举几个简单的例子[注1]供分析参考. 1. -Wall集合警告选项我们 ...
- 关于IO性能的一些学习与了解
关于IO性能的一些学习与了解 摘要 最近心气不高. 学习进度也拖的比较慢. 以后想能够多为自己着想.自己有自己的节奏, 不能只为别人考虑. 要改变一下自己的做事风格. 一些事情想帮则帮, 不想帮就当看 ...
- echarts设置暂无数据
场景描述 我们在项目中,很多时候都会使用echarts进行数据展示. 当没有数据的时候,echarts的展示就会特别的难看. 这个时候我们就会优化界面的显示,在echarts中展示暂无数据. 有很多中 ...
- 配置elementuI菜单
:unique-opened="true" 只保留一个菜单 :router="true"开启路由标识 index="users" 是标识 它 ...
- 使用AI辅助写代码
市面上的AI写代码 GitHub +OpenAI 出品的Copilot:https://copilot.github.com/ Tabnie:Code Faster with AI Code Comp ...
- 3.2 Windows驱动开发:内核CR3切换读写内存
CR3是一种控制寄存器,它是CPU中的一个专用寄存器,用于存储当前进程的页目录表的物理地址.在x86体系结构中,虚拟地址的翻译过程需要借助页表来完成.页表是由页目录表和页表组成的,页目录表存储了页表的 ...
- 三星发布990 EVO SSD:同时支持PCIe 4.0和PCIe 5.0
1月8日消息,三星发布了新款产品--990 EVO SSD,这是首款同时支持了PCIe 4.0 x4及PCIe 5.0 x2通道的SSD. 据了解,990 EVO面向中端市场,为2280 M.2规格, ...
- Java执行Shell和传输文件
特性: 多线程批量执行 多密码尝试 引入依赖: <dependency> <groupId>ch.ethz.ganymed</groupId> <artifa ...
- 基数排序|RadixSort|C++实现
前言 那么这里博主先安利一些干货满满的专栏了! 首先是博主的高质量博客的汇总,这个专栏里面的博客,都是博主最最用心写的一部分,干货满满,希望对大家有帮助. 高质量干货博客汇总https://blog. ...
- Python初学(请大神多多指教)
python的注释单行注释用#号多行注释用''' '''注释 基本数据类型 字符串-- n1 = "alex" n2 = 'root' n3 = " ...