'Django - Site matching query does not exist

Im trying to get the admin site of my app in Django working. Ive just sync`d the DB and then gone to the site but I get the error ...

Site matching query does not exist.

Any ideas ?



Solution 1:[1]

Add django.contrib.sites in django INSTALLED_APPS and also add SITE_ID=1 in your django setting file.

Solution 2:[2]

Adding SITE_ID=1 on settings.py did the trick for me.

Solution 3:[3]

You also need to make sure that the site domain is the same with the one you actually use. For example if you are you are accessing the admin site from http://127.0.0.1:8000/admin/ then your site.domain should be: site.domain = '127.0.0.1:8000'.

Solution 4:[4]

Try out this in settings.py:

SITE_ID = 1

Solution 5:[5]

I'm using wsgi, so I had to reboot twice, not sure why.

then clear cache and that was it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CoderGuy123
Solution 2 Cesar Gamboa Avellan
Solution 3 Josh Crozier
Solution 4 Mohamed El Firdoussi
Solution 5 Brian Sanchez