Reputation: 3574
I am able to connect to my remote database using psycopg2 in standalone Python 2.6 program, but cannot establish connection from within controller in Pylons.
How can I do that?
EDIT: exception value I am getting is could not translate host name "localhost:7780" to address: Name or service not known
I am creating ssh tunnel to connect to remote database.
Upvotes: 2
Views: 3420
Reputation: 2073
Set your Database settings like this.
host='localhost'
port='7780'
dbname='mydatabase'
user='myusername'
password='mypassword'
Your error is just coming due to this setting host='localhost:7780'
Upvotes: 1
Reputation: 3574
Problem solved by changing url format from
"host='localhost:7780' dbname='mydb' user='me' password='mypassword'"
to
"host='localhost' port='7780' dbname='mydb' user='me' password='mypassword'"
.
Upvotes: 4