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?
django-allauth is an integrated set of Django applications dealing with account authentication, registration, management, and third-party (social) account authentication. It is one of the most popular authentication modules due to its ability to handle both local and social logins.
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.
You can find the site_id in the address bar.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With