2017-03-12 32 views
0

我想將PostgreSQL數據庫與我的新項目連接,我在設置模塊和遷移中正確執行了所有操作,但無法訪問我的管理頁面?使用PostgreSQL數據庫無法訪問管理頁面

enter image description here

enter image description here

+0

[網站匹配查詢不存在]的可能的複製(HTTP:/ /stackoverflow.com/questions/11814059/site-matching-query-does-not-exist) – Withnail

回答

0

每個Django應用程序需要一個Site運行,所以 在Django編寫shell

$> ./manage.py shell 
>>> from django.contrib.sites.models import Site 
>>> site = Site() 
>>> site.domain = 'example.com' 
>>> site.name = 'example.com' 
>>> site.save() 
+0

編寫shell後出現新錯誤。 – esnaf96

+0

錯誤:「重複鍵值違反了唯一約束條件」 – esnaf96

+0

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這些鏈接可能會幫助你 –