2017-08-02 60 views
0

我試圖運行Django的遷移來更新我的數據庫,但「manage.py遷移」無法連接到我的postgresql數據庫。奇怪的是:我的django網站(這是完全相同的代碼)正在工作,包括連接到數據庫。django網站工作,但Django的manage.py無法連接到db

錯誤消息:

psycopg2.OperationalError: could not connect to server: No such file or directory 
     Is the server running locally and accepting 
     connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.xxxxxx"? 

django.db.utils.OperationalError: could not connect to server: No such file or directory 
     Is the server running locally and accepting 
     connections on Unix domain socket "/var/run/postgresql/.s.PGSQL 

回答

-1
+1

強烈建議僅限鏈接回答。如果您發佈的鏈接有關於此事的有價值的信息,請在此複製相關信息(假設許可證允許)或將其與鏈接一起總結。我們永遠不知道鏈接何時會失效。 – spectras

+0

@spectras我更關心Google尋找我的答案,以便其他人可以從中受益。鏈接指向更多信息。我只是在stackoverflow上包含這個問題和答案,以便其他人可以找到它。當我面臨這個問題時,答案並不是在計算器上,當有人發現它時,我感到非常幸運和欣賞。所以,我傳遞了良好的業力。 – TaiwanGrapefruitTea