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?
Asked
Active
Viewed 369 times
0
-
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 Answers
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()

Shakhawat Hossain
- 696
- 5
- 12
-
-
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