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 <module>
        from .models import User
       File "/home/bsodgm/Desktop/Django_projection/mall/apps/users/models.py", line 6, in <module>
            class User(AbstractUser):
       File "/home/bsodgm/.virtualenvs/django_py3/lib/python3.5/site-packages/django/db/models/base.py", line 118, in __new__
            "INSTALLED_APPS." % (module, name)
       RuntimeError: Model class apps.users.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

问题:

  代码路径导入出错

解决:

  from demo.models import User


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM