You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, find_dotenv takes the cwd or the directory of the python file that called it. This does not allow specifying a custom directory to search for the .env file without temporarily switching the cwd before calling find_dotenv.
Proposed solution
Add a dir: Optional[StrPath] argument and use that instead of inferring if it's not None.
The text was updated successfully, but these errors were encountered:
I have a similar use case to this. I have multiple projects within a single repo that all use similar environment variables. Right now, I have an .env file for each project. Whenever I change the value of one variable, I have to change it in all .env files. It would be great if I could define a single .env file in the parent directory, and python-dotenv would look that up.
The issue
Currently,
find_dotenv
takes the cwd or the directory of the python file that called it. This does not allow specifying a custom directory to search for the.env
file without temporarily switching the cwd before callingfind_dotenv
.Proposed solution
Add a
dir: Optional[StrPath]
argument and use that instead of inferring if it's not None.The text was updated successfully, but these errors were encountered: