python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

Documentation isn't specific on where it looks for a .env file

Open tbblake opened this issue 2 years ago • 1 comments

I can't find it anywhere in the docs where the module looks for .env files specifically, just "the root of your project". I did some testing and it seems to look in $HOME and the same directory as the python code, favoring the code directory, but was wondering where it'll look overall?

tbblake avatar Apr 26 '23 21:04 tbblake

I'm guessing it starts in the code directory, then .., then .. again, all the way up to the root of the drive? I'm guessing based on looking at the code for the module.

tbblake avatar Apr 26 '23 21:04 tbblake

@tbblake Yes you guessed it right, I've clarified it in the readme and reference docs https://saurabh-kumar.com/python-dotenv/reference/#dotenv.load_dotenv

theskumar avatar Apr 29 '24 04:04 theskumar