Django-allauth: Site Matching Query Does Not Exist

Updated Authentication

Have you tried installing django-allauth and encountered this particular error?

Allauth Error Page

I did, too, recently, and I've been successfully using django-allauth for years, so you're in good company! The issue is that the quickstart guide leaves out a critical piece of configuration: setting a SITE_ID in the settings.py file.

# settings.py
SITE_ID = 1  # new

If this configuration isn't present, the sites framework, which is closely linked to django-allauth, won't work. You'll receive this somewhat cryptic error message: "Site matching query does not exist."

If you want a complete guide to configuring Django and django-allauth, check out the complete tutorial available here.

Related Tutorials

  • Django Login, Logout, Signup, Password Change, and Password Reset

    Updated

    Django 6.1 user authentication complete tutorial with source code for login, logout, signup, password change, and password reset.

    Authentication
    View Tutorial
  • Django UserProfile Model

    Updated

    How to set up authentication with a UserProfile model and custom user model using signals.

    Authentication
    View Tutorial
  • Django-allauth Tutorial

    Updated

    Add user authentication including signup, login, and logout using django-allauth.

    Authentication
    View Tutorial