I think the load_dotenv
function fetches the environment variable's cached value. It can be resolved by enabling an override prop in the load_dotenv
function.
using this you can fetch the correct value whenever it is updated in the correct order, I think this will help(taken from the docs of python dotenv - https://pypi.org/project/python-dotenv/) -
load_dotenv(override=True)