load_dotenv
Load "dotenv" files to set environment variables. A given path takes precedence over .env, which takes precedence over .flaskenv. After loading and combining these files, values are only set if the key is not already set in os.environ.
def load_dotenv(
path: str | os.PathLike[str] | None = None,
load_defaults: bool = True
) - > bool
Load "dotenv" files to set environment variables. A given path takes precedence over .env, which takes precedence over .flaskenv. After loading and combining these files, values are only set if the key is not already set in os.environ.
Parameters
| Name | Type | Description |
|---|---|---|
| path | `str | os.PathLike[str] |
| load_defaults | bool = True | Whether to search for and load the default .flaskenv and .env files in the current directory. |
Returns
| Type | Description |
|---|---|
bool | True if at least one env var was loaded. |