Reads key-value pairs from a .env file and can set them as environment variables. It helps in developing applications following the 12-factor principles.
It worked fine in my original testing, but the next day it stopped working. I changed to using load_dotenv("path/to/file") and just having 'my_key' and 'my_key_id' as environment variables. That worked fine (and continues to work). I could not find any code changes and the file with my RSA keys remained the same in both instances.
Is there something that might have caused this behavior, or am I (likely) not seeing a change/typo in my code?
I'm not aware of any change in our code that could have caused this. If you have more information about your environment, test file and the version of python-dotenv being used, that would be great.
I set up a Django settings.py file to load RSA keys from a file into a dict with dotenv_values():
key_config = dotenv_values("path/to/file")
my_key = key_config['my_key'] my_key_id = key_config['my_key_id']
It worked fine in my original testing, but the next day it stopped working. I changed to using load_dotenv("path/to/file") and just having 'my_key' and 'my_key_id' as environment variables. That worked fine (and continues to work). I could not find any code changes and the file with my RSA keys remained the same in both instances.
Is there something that might have caused this behavior, or am I (likely) not seeing a change/typo in my code?
Thanks--
Al