I,m stuck with my flask uwsgi application, which cannot see environmental variables, i put those in .bash_profile file, like export key="variable", and typed source ~/.bash_profile, but no effect.
One possible solution would be to use python-dotenv
, add your environment variables to a .env
file and then, in your config.py
or whatever you use for loading environment variables, import it and call load_dotenv()
. Then you can use
variable = os.getenv('variable_declared_in_dotenv')
to load it.