Questions tagged «django-rest-auth»

5
RuntimeError:模型类django.contrib.sites.models.Site未声明显式的app_label且不在INSTALLED_APPS中的应用程序中
我正在使用Django Rest Framework和AngularJs构建应用程序。我使用Django-rest-auth进行身份验证,但是我无法对其进行设置。无论如何,我正尝试在我的项目中设置此应用。我意识到我需要安装django-rest-auth-registration来使其运行,所以我按照此文档进行了以下操作: 我运行了命令 pip安装django-rest-auth 和 点安装django-allauth 我的任何settings.py如下所示: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # 3rd party apps 'rest_framework', 'rest_framework.authtoken', 'rest_auth', 'allauth', 'allauth.account', 'rest_auth.registration', # My app 'myapp', ] 我还添加了身份验证后端,context_processors和正确的URL。 但是,当我尝试迁移时,终端抛出以下错误: RuntimeError:模型类django.contrib.sites.models.Site未声明显式的app_label,也不在INSTALLED_APPS的应用程序中。 为什么会出现此错误,以及如何解决该错误以迁移项目?谢谢!
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.