无法在NameSheap中的Django中安装Postgresql

无法在NameSheap中的Django中安装Postgresql,django,database,postgresql,installation,namecheap,Django,Database,Postgresql,Installation,Namecheap,它说它正在尝试连接到“::1”,这是“localhost”的IPv6版本 您可能希望尝试将“127.0.0.1”作为要连接的主机(可能有访问权限)或主机上unix套接字的路径,该路径通常类似于“/var/run/postgresql/”(如果不确定,请检查postgresql.conf) 或者,如果您想连接到IPv6本地主机,请更新PostgreSQL的pg_hba.conf以允许访问。将“localhost”更改为“127.0.0.1”对我来说很有效。 connection = Datab

它说它正在尝试连接到“::1”,这是“localhost”的IPv6版本

您可能希望尝试将“127.0.0.1”作为要连接的主机(可能有访问权限)或主机上unix套接字的路径,该路径通常类似于“/var/run/postgresql/”(如果不确定,请检查postgresql.conf)

或者,如果您想连接到IPv6本地主机,请更新PostgreSQL的pg_hba.conf以允许访问。

将“localhost”更改为“127.0.0.1”对我来说很有效。
  connection = Database.connect(**conn_params)
  File "/home/hatelsln/virtualenv/myunion/3.6/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "::1", user "hatelsln_hatelsln", database "hatelsln_myunion", SSL off