不正确的配置:AUTH_USER_MODEL升级django和django-registration

时间:2016-01-12 11:55:25

标签: python django django-registration

我正在尝试将旧的Django 1.4安装升级到Django 1.8,并且还将django-registration 1.0.0升级到django-registration-2.0.4

我遇到了RegistrationForm的问题,该问题表明它的配置非常糟糕。 MyRegistrationForm只是:

class MyRegistrationForm(RegistrationForm):
    captcha = ReCaptchaField()

当我加载主页时,我得到:

...
File "/mypath/wwwmyproject/src/website/myproject/core/urls.py", line 2, in <module>
    from myproject.core.views import MyRegistrationForm
  File "/mypath/wwwmyproject/src/website/myproject/core/views.py", line 31, in <module>
    from registration.forms import RegistrationForm
  File "/mypath/wwwmyproject/src/website/venv/lib/python2.7/site-packages/registration/forms.py", line 24, in <module>
    User = get_user_model()
  File "/mypath/wwwmyproject/src/website/venv/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 155, in get_user_model
    "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
ImproperlyConfigured: AUTH_USER_MODEL refers to model 'auth.User' that has not been installed

我见过很多Stackoverflow问题,主题相同,特别是: AUTH_USER_MODEL refers to model that has not been installed ...但我仍无法查明我的问题。

0 个答案:

没有答案