Grab environment variables on boot

Hi, I was wondering, how can I access the environment variables from within my app? I have a .env file where my app grabs all the needed tokens to start like databases, but I don’t want to upload that to Github, instead the app goes and grabs the info from the console itself. Thanks in advance!

Hi @Aggis15,

The best practice is to use the .env file for the local development, you don’t push your .env because you’ll expose your secret token and we don’t want it to happens. You can set environment variable inside your application on the Qovery Admin Panel for the production.

You can find more informations here: Environment Variables | Docs | Qovery

2 Likes

I’m sorry if my question wasn’t clear enough. My original question was how can I grab the environment values within my app? Like, for .env files, I use os.getenv("value"). Is it the same with Qovery?

Yes, the .env file inject into your application process the variable you list into it. So in Qovery it’s the same, you list your environment variable with the Qovery admin panel of your application and it will inject them into the process of your application :wink: