Postgres private url connection not working with django
bigrus24
HOBBYOP

2 years ago

PRODPOSTGRESURL="${{Postgres.DATABASEURL}}" DATABASES = { 'default': djdatabaseurl.parse( os.getenv("PRODPOSTGRESURL"), connmaxage=600, connhealth_checks=True,
)
}

django.db.utils.OperationalError: connection to server at "postgres.railway.internal" (fd12:4080:6f12::8d:f044:c20d), port 5432 failed: Connection timed out

{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "sleep 3 && python manage.py migrate --no-input && python manage.py collectstatic --no-input && gunicorn embermanager.asgi:application --bind 0.0.0.0:$PORT --forwarded-allow-ips=\"*\" -k uvicorn.workers.UvicornWorker --workers 3",
"restartPolicyType": "NEVER",
"restartPolicyMaxRetries": 10
}
}

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

2 Replies

2 years ago

When developing locally you need to use the public host and port for the database.


bigrus24
HOBBYOP

2 years ago

This is not local this is in railway


Loading...