Postgres private url connection not working with django
bigrus24
HOBBYOP

2 years ago

PROD_POSTGRES_URL="${{Postgres.DATABASE_URL}}"

DATABASES = {

'default': dj_database_url.parse(

os.getenv("PROD_POSTGRES_URL"),

conn_max_age=600,

conn_health_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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...