Skip to content

Env settings

Settings

Bases: BaseSettings

Application settings loaded from environment variables or a .env file.

The SettingsConfigDict ensures that environment variables take precedence, followed by values defined in the '.env' file.

Source code in src/stremio_addon_python_template/env_settings.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class Settings(BaseSettings):
    """Application settings loaded from environment variables or a .env file.

    The SettingsConfigDict ensures that environment variables take precedence,
    followed by values defined in the '.env' file.
    """

    model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")

    # Core Addon Settings
    PORT: int = 7000
    ADDON_ID: str = "community.example.stremioaddonpythontemplate"

    # Logging
    DEV_MODE: bool = False