0

I'm trying to upgrade an old Django 1.4 installation to Django 1.8, and with that also django-registration 1.0.0 to django-registration-2.0.4

I'm running into an issue with RegistrationForm, which says it's impopertly configured. MyRegistrationForm is simply:

class MyRegistrationForm(RegistrationForm):
    captcha = ReCaptchaField()

and when I load the home page, I get:

...
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

I've seen many Stackoverflow questions with the same subject, in particular: AUTH_USER_MODEL refers to model that has not been installed ... but still I can't pinpoint my issue.

Community
  • 1
  • 1
gozzilli
  • 8,089
  • 11
  • 56
  • 87
  • Do you have `django.contrib.auth` app in your `INSTALLED_APPS` in settings? Please post your `settings.py`. – masnun Jan 12 '16 at 12:00
  • Yes, `django.contrib.auth` is at the top of `INSTALLED_APPS` – gozzilli Jan 12 '16 at 12:01
  • You seem to have `AUTH_USER_MODEL` in settings pointing to `auth.User` - is this a custom model or you want `django.contrib.auth.models.User`? – masnun Jan 12 '16 at 12:03
  • No, it's not a custom model. I think that comes from the function call `User = get_user_model()` in `django-registration`'s `forms.py` – gozzilli Jan 12 '16 at 12:18
  • Do you mind posting your `settings.py` file? I am interested to know if there's any `AUTH_USER_MODEL` definition in it. – masnun Jan 12 '16 at 12:21

0 Answers0