agilmind
By:
agilmind

I can't connect to a PostgreSQL from Django in Dokku: could not connect to server: Connection timed out

June 8, 2015 1.3k views
Dokku PostgreSQL Django Python Docker Ubuntu

I can't connect to a PostgreSQL from Django in Dokku

When I run:
$ dokku run hello python manage.py migrate

Result:
django.db.utils.OperationalError: could not connect to server: Connection timed out
Is the server running on host "172.17.42.1" and accepting

TCP/IP connections on port 32769?

But if I run:
$ psql -h 172.17.42.1 -p 32769 -U root db

The result is OK:
Password for user root:
psql (9.3.7)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

db=#

Be the first one to answer this question.