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 users.views import UserViewSet
File "/home/hehecat/PycharmProjects/MxShop/apps/users/views.py", line 13, in
from users.models import EmailVerifyCode
File "/home/hehecat/PycharmProjects/MxShop/apps/users/models.py", line 8, in
class UserProfile(AbstractUser):
File "/home/hehecat/anaconda3/envs/restful/lib/python3.6/site-packages/django/db/models/base.py", line 118, in new
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
users的model无法正确引入
根据提示去setting中的INSTALLED_APPS 看看
INSTALLED_APPS = [
...
'users.apps.UsersConfig',
...
]
'users.apps.UsersConfig' 直接修改为‘users’,正确
那就是apps.UsersConfig有问题了
users/apps.py
class UsersConfig(AppConfig):
name = 'app.users'
verbose_name = '用户'
name修改name = 'users'为即可
RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.的更多相关文章
- 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 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文件 ...
- 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 ...
- 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 "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 ...
- 在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 ...
- django.db.utils.ProgrammingError: (1146, "Table 'db_gold.user_ip_info' doesn't exist") RuntimeError: Model class scanhosts.models.HostLoginInfo doesn't declare an explicit app_label and isn't in an a
Error Msg 创建了一个apps的目录将所有app放入apps文件中, 将apps路径加入sys.path中:sys.insert(0, os.path.join(BASE_DIR, " ...
- 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 ...
随机推荐
- MySQL参数: innodb_flush_log_at_trx_commit和sync_binlog
innodb_flush_log_at_trx_commit 当innodb_flush_log_at_trx_commit=0时, log buffer将每秒一次地写入log file, 并且log ...
- [原][工具][global mapper]查看图元属性(查看shp文件属性值)
常用的shp文件需要查看其内部字段 目前常用的有三种方法: 1.使用excel打开dbf文件,直接查看shp数据库文本文件 2.使用global mapper查看shp图元,然后通过内部工具查看“图元 ...
- 一、postman简介
一.场景 1.开发接口的时候需要快速的调用接口,以便调试 2.测试的时候需要非常方便的调用接口,通过不同的参数去测试接口的输出 3.这些接口调用是需要保存下来的反复运行的 4.在运行过程中如果有断言( ...
- 多线程查询数据,将结果存入到redis中,最后批量从redis中取数据批量插入数据库中【我】
多线程查询数据,将结果存入到redis中,最后批量从redis中取数据批量插入数据库中 package com.xxx.xx.reve.service; import java.util.ArrayL ...
- 详细介绍Oracle数据库的聚簇技术
作者:☜ Tracy ☞ 1. 什么是聚簇 d1=A=: 聚簇是根据码值找到数据的物理存储位置,从而达到快速检索数据的目的.聚簇索引的顺序就是数据的物理存储顺序,叶节点就是数据节点.非聚簇索引的顺序与 ...
- Python subprocess中的run方法
调用subprocess的推荐方法是对于它可以处理的所有使用场景都使用run()函数. run()函数是在Python 3.5中添加的,如果在老版本中使用,需要下载并扩展. 扩展安装方式: $ pip ...
- curl --resolve 查看证书情况
通过curl 解析证书 [root@harbor ~]# curl --resolve 'www.abc.com:127.0.0.1' https://www.abc.com/ -vvv * Cou ...
- 2019年Java面试题基础系列228道(5)
21.存在两个类,B 继承 A,C 继承 B,我们能将 B 转换为C 么?如 C = (C) B: 这属于强制类型转换,如果被转换的B实例不是C类型,会有异常 比如你的ABC分别对应动物,猫,黑猫. ...
- 按键板的原理与实现----ADC
在嵌入式系统产品开发中,按键板的设计是最基本的,也是项目评估阶段必须要考虑的问题.其实现方式又很多种,具体使用那一种就需要结合特定IC的可用IO数量,并综合考虑成本,做出最终选择.本系列文章将介绍多种 ...
- 手把手带你入门神秘的RxJava
1.什么是RxJava• Rx是Reactive Extensions的简写,翻译为响应的扩展.也就是通过由一方发出信息,另一方响应信息并作出处理的核心框架代码. • 该框架由微软的架构师Erik M ...