#config.py for env variables

9 messages · Page 1 of 1 (latest)

celest spoke
#

Is possible to use config.py for env variables?
I'd like to deploy my project from a public github repo
for local dev I have a config.py with the env variables (It gets imported with import config)
How can I set it up so it'll import the var on railway as well?

misty flame
#

you should inject your variables via, env vars. and not commit secrets to your repo

celest spoke
misty flame
#

yeye. but im asming config.py can feed of env vars right?

#

so you can just use env vars when running on railway

celest spoke
#

I'm not sure
I'll look into that

celest spoke
#

Looks like the best way is to go with the load_dotenv module and just use a .env file

misty flame
#

that sounds reasonable to me

celest spoke
#

Is there a way to mark this post as solved?