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 automatically search for and load the standard .flaskenv and .env files from the current directory. |
Returns
| Type | Description |
|---|---|
bool | True if at least one environment variable was successfully loaded into the process environment. |