R
Railway11mo ago
IssaKass

Question about environment variables

I have a question about Railway environment variables. I am deploying a flask app with postgresql to Railway App, and setting up env variables. Does these variables depends on the variables that are used while developing the app? Or vice versa?
7 Replies
Percy
Percy11mo ago
Project ID: N/A
Fragly
Fragly11mo ago
Does these variables depends on the variables that are used while developing the app? Or vice versa?
mind explaining what you mean by that?
IssaKass
IssaKassOP11mo ago
I have some configuration file and .env file in flask that contains some SECRET_KEY and database url. Does these depends on railway env variables?
Fragly
Fragly11mo ago
I'm still not sure what you mean by "depends on railway env variables" when deploying your app on railway, everything that would normally go in your .env file would go in your Service Variables, that way Railway can add these environment variables into your app ( Keep in mind though, Railway doesn't create a .env file for you, neither should you have a .env file in your production app )
IssaKass
IssaKassOP11mo ago
so I should not use the environment variables from Railway in my code? ?
Fragly
Fragly11mo ago
what environment variables from Railway?
Adam
Adam11mo ago
You’re going to have to be more clear, I don’t know what you mean by “do these variables depend on the variables that are used while developing the app” if you mean “will the environment variables be the same as what they are locally”, then no. Not unless you set them yourself If you are referring to the postgres db credentials, your railway postgres db should be different than your local development db
Want results from more Discord servers?
Add your server