django-allauth SITE_ID error

user21398 picture user21398 · Jan 8, 2014 · Viewed 11.2k times · Source

I'm learning django and have decided to use django-allauth for user registration. I currently only want local accounts (I've excluded social auth from settings.py).

When I access /accounts/login I get the following error:

You're using the Django "sites framework" without having set the SITE_ID setting. Create a site in your database and set the SITE_ID setting to fix this error.

The Official Django docs say:

The ID, as an integer, of the current site in the django_site database table. This is used so that application data can hook into specific sites and a single database can manage content for multiple sites.

But I don't quite understand this. Right now I'm just running django in a development environment, and normally just doing python manage.py runserver gets things running and I can test my app.

How do I fix this SITE_ID issue with local accounts? Would the solution be different in production/development environments?

Answer

Amir Nabaei picture Amir Nabaei · Mar 22, 2014

Adding "SITE_ID = 1" to your settings will get you past the exception without having to add it to INSTALLED_APPS. It worked for me.