Skip to content

Commit

Permalink
docs: clearify default behaviour of load_dotenv
Browse files Browse the repository at this point in the history
closes #457
  • Loading branch information
theskumar committed Apr 29, 2024
1 parent 8c9381e commit 08937a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ configurable via the environment:
```python
from dotenv import load_dotenv

load_dotenv() # take environment variables from .env.
load_dotenv() # take environment variables

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

By default, `load_dotenv` doesn't override existing environment variables.
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.

To configure the development environment, add a `.env` in the root directory of your
project:
Expand Down
4 changes: 3 additions & 1 deletion src/dotenv/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ def load_dotenv(
Bool: True if at least one environment variable is set else False
If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the
.env file.
.env file with it's default parameters. If you need to change the default parameters
of `find_dotenv()`, you can explicitly call `find_dotenv()` and pass the result
to this function as `dotenv_path`.
"""
if dotenv_path is None and stream is None:
dotenv_path = find_dotenv()
Expand Down

0 comments on commit 08937a1

Please sign in to comment.