Errors with django-rest-auth and django-allauth

1,125 views
Skip to first unread message

Daniel Grace

unread,
Jun 20, 2015, 3:53:07 AM6/20/15
to django...@googlegroups.com
I have installed Django (1.8), django-allauth (0.20.0) django-rest-auth (0.4.0).

I added to INSTALLED_APPS in settings.py:
    'rest_framework',
    'rest_framework.authtoken',
    'rest_auth'
    'allauth',
    'allauth.account',
    'rest_auth.registration',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.facebook',

And I added to TEMPLATES - OPTIONS - context_processors in settings.py:
    'django.core.context_processors.request',
    'allauth.account.context_processors.account',
    'allauth.socialaccount.context_processors.socialaccount',

When I run the server (python manage.py runserver) I get several errors:
C:\Users\Daniel\venvs\castle\lib\site-packages\django\contrib\sites\models.py:78
: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't
 declare an explicit app_label and either isn't in an application in INSTALLED_A
PPS or else was imported before its application was loaded. This will no longer
be supported in Django 1.9.
  class Site(models.Model):

C:\Users\Daniel\venvs\castle\lib\site-packages\django\contrib\sites\models.py:78
: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't
 declare an explicit app_label and either isn't in an application in INSTALLED_A
PPS or else was imported before its application was loaded. This will no longer
be supported in Django 1.9.
  class Site(models.Model):

Performing system checks...

Unhandled exception in thread started by <function check_errors.<locals>.wrapper
 at 0x000000000438DBF8>
Traceback (most recent call last):
  File "C:\Users\Daniel\venvs\castle\lib\site-packages\django\utils\autoreload.p
y", line 223, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Daniel\venvs\castle\lib\site-packages\django\core\management\co
mmands\runserver.py", line 110, in inner_run
    self.validate(display_num_errors=True)
  File "C:\Users\Daniel\venvs\castle\lib\site-packages\django\core\management\ba
se.py", line 465, in validate
    return self.check(app_configs=app_configs, display_num_errors=display_num_er
rors)
  File "C:\Users\Daniel\venvs\castle\lib\site-packages\django\core\management\ba
se.py", line 524, in check
    raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check ide
ntified some issues:

ERRORS:
socialaccount.SocialApp.sites: (fields.E300) Field defines a relation with model
 'Site', which is either not installed, or is abstract

Stephen J. Butler

unread,
Jun 20, 2015, 4:31:12 AM6/20/15
to django...@googlegroups.com
One of your other apps needs django.contrib.sites, so you need to put it in your INSTALLED_APPS. That's what this means here:

Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded.

And here:


Field defines a relation with model 'Site', which is either not installed, or is abstract


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/826d3374-9eb3-4067-93e2-6be3e7bbe805%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luis Zárate

unread,
Jun 20, 2015, 10:44:16 AM6/20/15
to django...@googlegroups.com
As say Stephen Butler you need to install django.contrib.sites (it not enable by default) and set
SITE_ID = 1 in your settings.
Here is the reference:
https://docs.djangoproject.com/en/1.8/ref/contrib/sites/#enabling-the-sites-framework



--
"La utopía sirve para caminar" Fernando Birri


Reply all
Reply to author
Forward
0 new messages