Cannot read any environment variables in Python Fast API application
raziahmaddev
TRIALOP

a year ago

As the title says, cannot read any environment variables specified in the VARIABLES tab. I am trying to access them in my fast api application via os.getenv but it always returns none.

View Deploy details

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

5 Replies

a year ago

You added variables, but then never deployed the changes.


raziahmaddev
TRIALOP

a year ago

You added variables, but then never deployed the changes.

Hi, Thanks for replying. Not sure what you mean by deployed the changes. I added the variables, pushed a commit, then deployed. But the deployment crashed because it couldn't access my variables. Shouldn't they have been deployed alongwith the commit?


a year ago

Not unless you deploy the changes, click the deploy button on your project canvas.


raziahmaddev
TRIALOP

a year ago

Hi, It worked. Thanks. Have a quick question though, cannot find the generated url through which i can access my API.


a year ago

You can can generate a domain in the service settings.


Loading...