Is the server running on host "localhost" (::1) and accepting         TCP/IP connections on port 5

完整報錯如下:

django.db.utils.OperationalError: could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?

#-----------------------------------------------------------------------------------------------

根據5432可知,使用的是PostgreSQL數據庫.

所以需要檢查django中連接postgres的用戶名和密碼是否和實際數據庫的連接用的用戶名和密碼是否一致.

另外需要檢查該數據庫是否存在,如果不存在,需要建立.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章