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

posted @ 2018-10-12 17:48  HPCM  阅读(2389)  评论(0编辑  收藏  举报