Django — django.contrib.auth Login Issues: Site._meta.installed / Site matching query does not exist

Well, I wondered what happened here and googling was futile.

Was getting errors on django.contrb.auth.views.login

If Site._meta.installed:
current_site = Site.objects.get_current()

After reading into what that does, it pulls SITE_ID out of your settings to check what db to look into. Well, my django project had a SITE_ID of 2 from many months ago.

Simply changed that to one and problem fixed.

5 Comments

  1. Benjamin says:

    This was my problem exactly. Thanks so much!

  2. Yuji says:

    Awesome. Glad it helped somebody!

  3. Another one with the same problem, after over a year with Django. Weird. Thanks!

  4. Kevin says:

    saved me a lot of trouble, thanks 🙂

  5. If some one wishes expert view concerning blogging and site-building after that i suggest him/her to pay a
    visit this webpage, Keep up the good work.

Leave a reply to Michael Greene Cancel reply