Asyncz Settings¶
Asyncz exposes a small global settings object through asyncz.settings. The default implementation lives in asyncz.conf.global_settings.Settings.
Built-in settings¶
Settings currently defines:
debug: bool = Falseversion: str = asyncz.__version__secret_key: str | None = Nonedashboard_config: a property that buildsasyncz.contrib.dashboard.config.DashboardConfig
Loading a custom settings class¶
Point ASYNCZ_SETTINGS_MODULE at a class path:
Example:
from asyncz.conf.global_settings import Settings as BaseSettings
class Settings(BaseSettings):
debug = True
secret_key = "development-only-secret"
Accessing settings¶
from asyncz import settings
print(settings.debug)
print(settings.version)
print(settings.dashboard_config.dashboard_url_prefix)
You can also import the settings class itself:
Export helpers¶
BaseSettings includes convenience helpers:
settings.dict(...)settings.tuple(...)
Both support exclude_none, upper, exclude, and include_properties.
Dashboard configuration¶
settings.dashboard_config returns an asyncz.contrib.dashboard.config.DashboardConfig instance. That object controls dashboard-specific behavior such as:
dashboard_url_prefixtitleheader_titledescription- session middleware settings and cookie configuration
If secret_key is set on the root settings object, it is forwarded into DashboardConfig.