dokku / dokku-postgres

a postgres plugin for dokku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the server running on host "localhost" ?

welpie opened this issue · comments

I created dokku and created my app. Every code is working fine,but somehow my app and database is not working
together.I am getting this error when i am trying to git push:

Error

django.db.utils.OperationalError: could not connect to server: Connection refused
             Is the server running on host "localhost" (127.0.0.1) and accepting
             TCP/IP connections on port 5432?
       could not connect to server: Cannot assign requested address
             Is the server running on host "localhost" (::1) and accepting
             TCP/IP connections on port 5432?

Here are my steps to create and link the app:

git clone https://github.com/link
dokku apps:create welpie
dokku postgres:link welpiedb welpie
cd welpie
git remote add dokku dokku@dokku.me:welpie
git remote set-url dokku dokku@<ipadress>:welpie
git push dokku main:master

I get no error in any of these steps.I also check if welpiedb is running fine.

Dokku postgres:info welpiedb

       Dsn:                 postgres://postgres:**@dokku-postgres-welpiedb:5432/welpiedb
       Status:              running

Settings.py

DB_SETTINGS = dj_database_url.parse('postgres://postgres:**@dokku-postgres-welpiedb:5432/welpiedb')

How do i solve this problem?

The database does not run on localhost.

Not sure if you're still seeing this, but it almost sounds like your app isn't properly connecting to that remote host (dokku-postgres-welpiedb). Were you able to resolve this?

@josegonzalez I stopped using Dokku, it seems too complex for me to operate as i am a solo developer. I set up nginx and gunicorn myself without the Dokku so it is better for me now.

That’s too bad that you couldn’t get this working, definitely not the experience I’m trying to promote.

closing this for now. Thanks for responding!

It was on my end mostly, i am not too familiar with Dokku/Docker environment.
You can close it as there is nothing else to be discussed further :)

Good luck to all developers of Dokku, it ain't an easy to be a developer and suit all the needs of all end users!