對於我的Django項目,我使用'postgresql_psycopg2',我的數據庫駐留在網絡上的一個公共服務器上。我如何在MySQL中使用IP地址作爲'主機'來連接到那個數據庫?我曾嘗試,但始終顯示以下錯誤:Python-PostgreSQL:如何通過網絡IP連接數據庫
OperationalError at /
could not connect to server: Connection refused
Is the server running on host "" and accepting TCP/IP connections on port 5432?
你可以通過終端中的psql命令連接到你的數據庫,你的settings.py中有參數嗎? –