Skip to content

Commit 08937a1

Browse files
committed
docs: clearify default behaviour of load_dotenv
closes #457
1 parent 8c9381e commit 08937a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ configurable via the environment:
3636
```python
3737
from dotenv import load_dotenv
3838

39-
load_dotenv() # take environment variables from .env.
39+
load_dotenv() # take environment variables
4040

4141
# Code of your application, which uses environment variables (e.g. from `os.environ` or
4242
# `os.getenv`) as if they came from the actual environment.
4343
```
4444

45-
By default, `load_dotenv` doesn't override existing environment variables.
45+
By default, `load_dotenv` doesn't override existing environment variables and looks for a `.env` file in same directory as python script or searches for it incrementally higher up.
4646

4747
To configure the development environment, add a `.env` in the root directory of your
4848
project:

src/dotenv/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ def load_dotenv(
340340
Bool: True if at least one environment variable is set else False
341341
342342
If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the
343-
.env file.
343+
.env file with it's default parameters. If you need to change the default parameters
344+
of `find_dotenv()`, you can explicitly call `find_dotenv()` and pass the result
345+
to this function as `dotenv_path`.
344346
"""
345347
if dotenv_path is None and stream is None:
346348
dotenv_path = find_dotenv()

0 commit comments

Comments
 (0)