0

So, I'm trying to set up registration and I keep getting the error

Unhandled exception in thread started by

Traceback (most recent call last):

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception()

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate app_config.ready()

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/contrib/admin/apps.py", line 22, in ready self.module.autodiscover()

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/contrib/admin/init.py", line 26, in autodiscover autodiscover_modules('admin', register_to=site)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules import_module('%s.%s' % (app_config.name, module_to_search))

File "//anaconda/envs/hellovenv/lib/python2.7/importlib/init.py", line 37, in import_module import(name)

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/registration/admin.py", line 2, in from django.contrib.sites.models import RequestSite

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/contrib/sites/models.py", line 83, in class Site(models.Model):

File "//anaconda/envs/hellovenv/lib/python2.7/site-packages/django/db/models/base.py", line 102, in new "INSTALLED_APPS." % (module, name)

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

after running

pip install django-registration-redux==1.1

and my INSTALLED_APPS are

INSTALLED_APPS = [
    'collection', # this is the app we added
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.humanize',
    'registration',
]

Not being super familiar with python tracebacks I'm not sure which files to modify to fix this.

Thanx.

1
  • could you post the INSTALLED_APPS in settings.py? Commented Mar 29, 2016 at 0:57

1 Answer 1

0

from docs,

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.sites',
    'registration',
    # ...other installed applications...
)

django.contrib.sites seems to be omitted in your INSTALLED_APPS.

Sign up to request clarification or add additional context in comments.

3 Comments

is this the same error? and have you done the migration after setting up? the migration is necessary.
No it's a different error, and migration ends the same way: ImportError: cannot import name RequestSite
I guess you go for the update to the version 1.3...for this reason. Hope this helps...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.