Skip to content

Settings

Settings

Bases: BaseSettings

anystore settings management using pydantic-settings

Note

All settings can be set via environment variables in uppercase, prepending FTMQ_API_ (except for those with a given prefix)

Source code in ftmq_api/settings.py
class Settings(BaseSettings):
    """
    `anystore` settings management using
    [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/)

    Note:
        All settings can be set via environment variables in uppercase,
        prepending `FTMQ_API_` (except for those with a given prefix)
    """

    model_config = SettingsConfigDict(
        env_prefix="ftmq_api_",
        env_nested_delimiter="__",
        nested_model_default_partial_update=True,
    )

    debug: bool = Field(False, alias="debug")

    catalog: str | None = None
    """Catalog uri"""

    store_uri: str = DB_URL
    """ftmq store uri"""

    build_api_key: str = "secret-key-for-build"
    """Backend api key to use for build process (higher limit)"""

    min_search_length: int = 3
    """Minimum search query length"""

    use_cache: bool = False
    """Activate caching"""

    cache: StoreModel = StoreModel(
        uri=".cache", backend_config={"redis_prefix": f"ftmq-api/{__version__}"}
    )
    """Api cache (via anystore)"""

    allowed_origin: list[str] = ["http://localhost:3000"]
    """Allowed origins"""

    default_limit: int = 100
    """Default public pagination limit"""

    info: ApiInfo = ApiInfo()
    """Rendered information on redoc page"""

allowed_origin = ['http://localhost:3000'] class-attribute instance-attribute

Allowed origins

build_api_key = 'secret-key-for-build' class-attribute instance-attribute

Backend api key to use for build process (higher limit)

cache = StoreModel(uri='.cache', backend_config={'redis_prefix': f'ftmq-api/{__version__}'}) class-attribute instance-attribute

Api cache (via anystore)

catalog = None class-attribute instance-attribute

Catalog uri

default_limit = 100 class-attribute instance-attribute

Default public pagination limit

info = ApiInfo() class-attribute instance-attribute

Rendered information on redoc page

min_search_length = 3 class-attribute instance-attribute

Minimum search query length

store_uri = DB_URL class-attribute instance-attribute

ftmq store uri

use_cache = False class-attribute instance-attribute

Activate caching