Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django admin page is giving me 500 error in production [duplicate]

I am trying to setup django admin page for my site. for my local dev server it is working now fine, but once i pushed the code to server, and tried to open the admin page, it is giving me 500 error page.

i saw the traceback, it is saying: DoesNotExist: Site matching query does not exist.

but I dont know why and what is happening here. this is the whole traceback,

http://pastebin.com/QCdGWTDq

can someone please help me?

like image 846
doniyor Avatar asked May 13 '13 19:05

doniyor


1 Answers

Just add a Site object via Django shell on production site:

$ python manage.py shell
>>> from django.contrib.sites.models import Site
>>> Site.objects.create(domain='example.com', name='example.com')

Where example.com corresponds to your site's domain name used in production.

Normally a default Site object should be automatically created when you run the syncdb command, but I myself encountered cases when that didn't happen for some reason.

  • See also: Django's “sites” framework documentation
like image 182
Anton Strogonoff Avatar answered Nov 16 '22 22:11

Anton Strogonoff