Quantcast
Viewing all articles
Browse latest Browse all 14215

Python Project only taking env variables that were initialized at the very start

I am trying to use some variables using:

settings.py

from dotenv import dotenv_valuesconfig = dotenv_values("/etc/env/env_file")

Content of env_file:

TOP_MAX = 12KEY = value

It works fine at first, loading all the variables but after changing the content of the env file while the project is running, the functions using this variables are still using the old values. I get that after the project has started Python gets values from a cached variable, but I am looking for any workaround if any to load the current values of the env file in the function after it is modified while running. Sorry for the sloppy terminologies


Viewing all articles
Browse latest Browse all 14215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>