ocs: clarify what load_dotenv() does in README by cybercoded · Pull Request #575 · theskumar/python-dotenv

Expand Up @@ -36,13 +36,20 @@ configurable via the environment: ```python from dotenv import load_dotenv
load_dotenv() # take environment variables load_dotenv() # reads variables from a .env file and sets them in os.environ ```

# 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 and looks for a `.env` file in same directory as python script or searches for it incrementally higher up.
By default, `load_dotenv()` will:

- Look for a `.env` file in the same directory as the Python script (or higher up the directory tree). - Read each key-value pair and add it to `os.environ`. - **Not override** an environment variable that is already set, unless you explicitly pass `override=True`.
To configure the development environment, add a `.env` in the root directory of your project: Expand Down