0

I am trying to connect PostgreSQL database with my new project, I did everything properly in settings module and with migrations but I cannot access my admin page?

enter image description here

enter image description here

dur
  • 15,689
  • 25
  • 79
  • 125
Ismail Sarenkapic
  • 140
  • 1
  • 2
  • 9
  • Possible duplicate of [Site matching query does not exist](http://stackoverflow.com/questions/11814059/site-matching-query-does-not-exist) – Withnail Mar 12 '17 at 11:04

1 Answers1

1

Every django app needs a Site to run, So write in django shell

 $> ./manage.py shell
>>> from django.contrib.sites.models import Site
>>> site = Site()
>>> site.domain = 'example.com'
>>> site.name = 'example.com'
>>> site.save()
  • Error : "duplicate key value violates unique constraint" – Ismail Sarenkapic Mar 12 '17 at 15:49
  • http://stackoverflow.com/questions/11089850/integrityerror-duplicate-key-value-violates-unique-constraint-django-postgres http://stackoverflow.com/questions/34695323/django-db-utils-integrityerror-duplicate-key-value-violates-unique-constraint http://stackoverflow.com/questions/28615208/duplicate-key-value-violates-unique-constraint-while-saving-modelform these link may help you – Shakhawat Hossain Mar 12 '17 at 19:26