19 days ago
I set up my server but log after deployment says : none ; I added it 2 or 3 times now. i am new to this server.
7 Replies
19 days ago
I’m deploying a Flask app on Railway. I added DATABASE_URL under:
Architecture → Web Service → Variables
But during deployment, my debug print still shows:
DB_URL: None
psycopg2 then tries to connect via the default local socket:
"/var/run/postgresql/.s.PGSQL.5432"
and fails.
I’ve confirmed:
• The variable is saved in the Web Service
• The value matches the Postgres Connection URL
• The service was restarted after adding it
Still getting DB_URL: None in the deployment logs.
Any ideas on what I might be missing?
19 days ago
Additional context: Everything else in the deployment is working correctly — Google OAuth, redirect flow, callback route, and all other environment variables. The only issue is that DATABASE_URL is not being read by the Web Service, even though other variables in the same service load correctly.
19 days ago
thank you
19 days ago
Are you setting DATABASE_URL or DB_URL?
19 days ago
I’m setting the variable as DATABASE_URL in the Web Service, and in my code I’m calling:
DBURL = os.environ.get("DATABASEURL")
So the names match exactly. The debug print shows DB_URL: None even though the variable is present in the service’s Variables panel.
19 days ago
Have you tried using a different name? (Eg, DB_URL)
19 days ago
I haven’t tried renaming it yet, but I can test that. Just to clarify: the variable is currently named DATABASEURL in the Web Service, and my code calls os.environ.get("DATABASEURL"). All other variables in the same service load correctly.
I can try adding DB_URL as a second variable pointing to the same connection string to see if the Web Service picks that one up.