untimeError: Model class app_anme.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

关于django错误的导入错误

1.错误的导入方式如下:

2.正确的导入方式:

只有使用users.models的导入方式才能导入成功,使用绝对路径也不行。

ps:如有大神知道原因请告知,不胜感谢!

RuntimeError: Model class app_anme.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.---python学习错误记录的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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文件 ...

  4. RuntimeError: Model class myapp.models.Test doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

    没有添加子应用在settings里面!

  5. 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 ...

  6. 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, " ...

  7. 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 & ...

  8. 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 ...

  9. 在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 ...

随机推荐

  1. 单例模式-懒汉式的一次多线程Debug

    单例模式要要点就是一个类只会存在一个实例,要想达到这种效果,最重要的就是将构造方法设置为私有,然后通过static的方法来获取对象. 上述设计并不线程安全,因为在lazySingleton = new ...

  2. Oracle错误——ORA-39000:转储文件说明错误、ORA-39001:参数值无效、ORA-39088:文件名不能包含路径说明

    错误 在使用数据泵导入文件时,报错如下 Next 出错原因 在使用参数DUMPFILE指定文件名称时,不能包含路径信息,只可以使用文件名称 Next 解决办法 在使用数据泵进行数据导入导出前,必须要创 ...

  3. jQuary学习の四の遍历

    向上遍历DOM树: parent():返回被选元素的直接父元素 parents():返回被选元素的所有祖先元素(当后边参数存在时则表示其中与参数相同的祖先元素) parentsUntil()返回介于两 ...

  4. BZOJ-3208|记忆化搜索-花神的秒题计划Ⅰ

    背景[backboard]: Memphis等一群蒟蒻出题中,花神凑过来秒题-- 描述[discribe]: 花花山峰峦起伏,峰顶常年被雪,Memphis打算帮花花山风景区的人员开发一个滑雪项目. 我 ...

  5. LintCode 521.去除重复元素

    LintCode 521.去除重复元素 描述 给一个整数数组,去除重复的元素. 你应该做这些事 1.在原数组上操作 2.将去除重复之后的元素放在数组的开头 3.返回去除重复元素之后的元素个数 挑战 1 ...

  6. abap 增强查找小程序

    *&---------------------------------------------------------------------* *& Report  ZEXIT *& ...

  7. WebAPI前置知识:HTTP与RestfulAPI

    对HTTP协议的基本了解是能理解并使用RestFul风格API的基础,在了解了这些基础之后,使用各种RestFul的开发框架才能得心应手.我一开始使用WebApi的时候就因为对这些知识缺乏了解,觉得用 ...

  8. stylus入门学习笔记

    title: stylus入门学习笔记 date: 2018-09-06 17:35:28 tags: [stylus] description: 学习到 vue, 有人推荐使用 stylus 这个 ...

  9. java @FunctionalInterface

    public class Worker { private String doWork(String job) { return "Job " + job + " don ...

  10. leecode第二百三十一题(2的幂)

    class Solution { public: bool isPowerOfTwo(int n) { bool is_flag=false; ) { ==)//如果为1,看是不是第一个1 { if( ...