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
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,13 +36,20 @@ configurable via the environment:
36
36
```python
37
37
from dotenv import load_dotenv
38
38
39
-
load_dotenv() # take environment variables
39
+
load_dotenv() # reads variables from a .env file and sets them in os.environ
40
+
```
41
+
40
42
41
43
# Code of your application, which uses environment variables (e.g. from `os.environ` or
42
44
# `os.getenv`) as if they came from the actual environment.
43
-
```
44
45
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.
46
+
47
+
By default, `load_dotenv()` will:
48
+
49
+
50
+
- Look for a `.env` file in the same directory as the Python script (or higher up the directory tree).
51
+
- Read each key-value pair and add it to `os.environ`.
52
+
-**Not override** an environment variable that is already set, unless you explicitly pass `override=True`.
46
53
47
54
To configure the development environment, add a `.env` in the root directory of your
0 commit comments