Django model “doesn't declare an explicit app_label”

后端 未结 28 1919
無奈伤痛
無奈伤痛 2020-11-27 15:38

I\'m at wit\'s end. After a dozen hours of troubleshooting, probably more, I thought I was finally in business, but then I got:

Model class django.contrib.co         


        
28条回答
  •  隐瞒了意图╮
    2020-11-27 15:56

    I've got a similar error while building an API in Django rest_framework.

    RuntimeError: Model class apps.core.models.University doesn't declare an explicit > app_label and isn't in an application in INSTALLED_APPS.

    luke_aus's answer helped me by correcting my urls.py

    from

    from project.apps.views import SurgeryView
    

    to

    from apps.views import SurgeryView
    

提交回复
热议问题