【发布时间】:2019-06-06 16:53:15
【问题描述】:
我正在开发一个可以在移动设备上运行并连接到我计算机中的 PostGreSQL 数据库的应用程序。要将移动设备连接到服务器,我需要在以下代码中将计算机的 IP 作为“主机”参数提供?我正在使用 psycopg2 来设置 python 和 PostGres 之间的连接。
conpgs = psycopg2.connect(host='localhost', database='database', user='postgres', password='xxxx')
【问题讨论】:
标签: database python-3.x postgresql remote-access psycopg2