在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,VerifyCode
一运行项目就会报错!怎么破?
其实很简单,只要在views中这样写就可以了。
from users.models import UserProfile,VerifyCode
再运行一下项目,是不是就不报错,可以正常使用啦?
在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.的更多相关文章
- 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 & ...
- 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里面!
- 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 ...
- 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, " ...
- 在maven项目中引用ueditor报错问题
遇到的问题:将pom.xml中引入 <dependency> <groupId>com.baidu</groupId> <artifactId>uedi ...
- discuzx3.1中引用 Jquery报错的解决办法
我们可以引用jQuery给JQ赋予一个变量var jq = jQuery.noConflict(); 修改成为:<script type="text/javascript"& ...
随机推荐
- Socket构造但不连接
Socket socket = new Socket(); SocketAddress address = new InetSocketAddress("localhost",80 ...
- scrapy架构简介
一.scrapy架构介绍 1.结构简图: 主要组成部分:Spider(产出request,处理response),Pipeline,Downloader,Scheduler,Scrapy Engine ...
- echo "" > 和 echo "" >> 的区别
在写shell脚本中,如果判断一个文件已经存在,但希望重写这个文件,一般用如下方式 echo "" > file.txt 这个表示清空文件的内容,如果使用 echo “” & ...
- mvn clean deploy
如果是 mthrift的话,需要部署,就用 mvn clean deploy; 先进入 cd qcs.appeal.client ,然后执行:mvn clean deploy;
- include与__autoload与命名空间namespace与PSR4详解
1. include, require, include_once, require_once include和require是PHP中引入源文件最基本的用法,其他例如__autoload, name ...
- Jackson将对象转换为json字符串时,设置默认的时间格式
maven需要的依赖: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifac ...
- MySQL 大数据量分页优化
假设有一个千万量级的表,取1到10条数据: ,; ,; 这两条语句查询时间应该在毫秒级完成: ,; 你可能没想到,这条语句执行之间在5s左右: 为什么相差这么大? 可能mysql并没有你想的那么智能, ...
- Ibatis中的<trim>标签应用
<trim>的主要属性如下显示: <trim prefix="" prefixOverrides="" suffix="" ...
- Hadoop Brief
Hadoop是一个由Apache基金会所开发的分布式系统基础架构. 用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力进行高速运算和存储. [1] Hadoop实现了一个分布 ...
- iOS一些高效代码
一. [Bugly startWithAppId:BUGLY_APP_ID #if DEBUG developmentDevice:YES #endif config:config]; 二.