问题: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 ...
随机推荐
- nginx 企业版与开源版本的区别
- NutUI-React 京东移动端组件库 2月份上新!欢迎使用!
作者:京东零售 佟恩 NutUI 是一款京东风格的移动端组件库.NutUI 目前支持 Vue 和 React技术栈,支持Taro多端适配. 本次,是2月的一个示例输出,希望对你有帮助! 2月,我们对组 ...
- Unity2020或Unity2019安装后无法启动
无法启动Unity 下载国际版的Unity2020,双击Unity.exe无法启动,通过Unity Hub也无法启动 原因 通过查看unity hub的日志发现Unity 启动的时候会检查 lie ...
- SqlSugar分页查询
同步分页 int pagenumber= 1; // pagenumber是从1开始的不是从零开始的 int pageSize = 20; int totalCount=0; //单表分页 ...
- 深入探索OCR技术:前沿算法与工业级部署方案揭秘
深入探索OCR技术:前沿算法与工业级部署方案揭秘 注:以上图片来自网络 1. OCR技术背景 1.1 OCR技术的应用场景 OCR是什么 OCR(Optical Character Recogniti ...
- 19.7 Boost Asio 传输序列化数据
序列化和反序列化是指将数据结构或对象转换为一组字节,以便在需要时可以将其存储在磁盘上或通过网络传输,并且可以在需要时重新创建原始对象或数据结构. 序列化是将内存中的对象转换为字节的过程.在序列化期间, ...
- 21.14 Python 实现Web指纹识别
在当今的Web安全行业中,识别目标网站的指纹是渗透测试的常见第一步.指纹识别的目的是了解目标网站所使用的技术栈和框架,从而进一步根据目标框架进行针对性的安全测试,指纹识别的原理其实很简单,目前主流的识 ...
- C# 字符串转码后操作二进制文件
String转码后写入二进制文件,读二进制文件进行解码返回. public class BinaryClass { /// <summary> /// 写二进制文件 /// </su ...
- P9993 [Ynoi Easy Round 2024] TEST_133 题解
题目链接: [Ynoi Easy Round 2024] TEST_133 首先历史最大加,吉司机跑不掉了,维护历史最大加标记以及历史最大,那么根据吉司机标记思想更新操作应该为 \[new \Left ...
- 20.4 延迟加载DLL--《Windows核心编程》
延迟加载的 DLL 是个隐含链接的 DLL,它实际上要等到你的代码试图引用 DLL 中包含的一个符号时才进行加载. DLL延迟加载技术的原理,就是从导入表中去掉某dll这一项,等到正式调用DLL的时候 ...