RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

后端 未结 5 1852
情书的邮戳
情书的邮戳 2020-12-05 03:52

I am building an application with Django Rest Framework and AngularJs. I am using Django-rest-auth for my authentication purposes, although, I have not been able to set it u

5条回答
  •  [愿得一人]
    2020-12-05 04:18

    I got the error above. However my problem was the in the urls.py. I was following PyDanny cookiecutter django recipe. My error was to put in the urls.py this line:

        url(r'^demo/', include('project.demoapp.urls', namespace='demoapp')),
    

    when I corrected to this:

        url(r'^demo/', include('demoapp.urls', namespace='demoapp')),
    

    all was well. I also changed my local apps (I did this first and so the critical error was the url misconfiguration):

    LOCAL_APPS = [
        # Your stuff: custom apps go here
        'demoapp.apps.DemoAppConfig',
    ]
    

提交回复
热议问题