Wednesday, March 5, 2014

Site matching query does not exist -- Django


When migrating from sqlite3 to postgresql, after running

python syncdb

got error message “Site matching query does not exist.

The cause: 

Table django_site does not have any entry.

The fix: 

python shell
from django.contrib.sites.models import Site
Site.objects.create(pk=1, domain='', name='localhost'

Credit :