Just wanted to get any good practice how you deal with enviroment variables, and secrets like database informations(or anything else that is considered as secret).
I am new to this, and I want to get some advice from developers with experience on this case.
And please if you give me some help, that could be great(if possible) with a small explaination(source code).
Thank to this awesome community in advance.
I'd like to point you in a couple of directions:
BaseSettings classIs this a good start for you?
took me a while to understand how to manage that properly, here is my way of managing them:
export | grep APP_ | sed -e 's/APP_//g' | sed -e 's/declare -x //g' > ./app/settings/.envand voil脿, nothing complicated for me
P.S. I'm not Facebook nor Google so it might be not top of the top but for my needs this is very easy to manage and secure enough.
Hope it helps
Thanks for the help here everyone! :cake:
Thanks @vjanz for closing the issue.
You might also want to check the new docs for settings and env vars: https://fastapi.tiangolo.com/advanced/settings/
Most helpful comment
took me a while to understand how to manage that properly, here is my way of managing them:
export | grep APP_ | sed -e 's/APP_//g' | sed -e 's/declare -x //g' > ./app/settings/.envand voil脿, nothing complicated for me
P.S. I'm not Facebook nor Google so it might be not top of the top but for my needs this is very easy to manage and secure enough.
Hope it helps