settings¶
Application settings
Application settings.
Secrets are consumed from env vars.
- class app.config.settings.ViteSettings(DEV_MODE: bool = <factory>, USE_SERVER_LIFESPAN: bool = <factory>, HOST: str = <factory>, PORT: int = <factory>, HOT_RELOAD: bool = <factory>, ENABLE_REACT_HELPERS: bool = <factory>, BUNDLE_DIR: ~pathlib.Path = <factory>, RESOURCE_DIR: ~pathlib.Path = <factory>, TEMPLATE_DIR: ~pathlib.Path = <factory>, ASSET_URL: str = <factory>)[source]¶
Bases:
object
Server configurations.
- property set_static_files: bool¶
Serve static assets.
- Returns:
True if the asset URL is a relative path.
- Return type:
- __init__(DEV_MODE: bool = <factory>, USE_SERVER_LIFESPAN: bool = <factory>, HOST: str = <factory>, PORT: int = <factory>, HOT_RELOAD: bool = <factory>, ENABLE_REACT_HELPERS: bool = <factory>, BUNDLE_DIR: ~pathlib.Path = <factory>, RESOURCE_DIR: ~pathlib.Path = <factory>, TEMPLATE_DIR: ~pathlib.Path = <factory>, ASSET_URL: str = <factory>) None ¶
- class app.config.settings.ServerSettings(APP_LOC: str = 'app.asgi:app', APP_LOC_IS_FACTORY: bool = False, HOST: str = <factory>, PORT: int = <factory>, KEEPALIVE: int = <factory>, RELOAD: bool = <factory>, RELOAD_DIRS: list[str] = <factory>, HTTP_WORKERS: int | None = <factory>)[source]¶
Bases:
object
Server configurations.
- class app.config.settings.LogSettings(EXCLUDE_PATHS: str = '\\A(?!x)x', HTTP_EVENT: str = 'HTTP', INCLUDE_COMPRESSED_BODY: bool = False, LEVEL: int = <factory>, OBFUSCATE_COOKIES: set[str] = <factory>, OBFUSCATE_HEADERS: set[str] = <factory>, REQUEST_FIELDS: list[RequestExtractorField] = <factory>, RESPONSE_FIELDS: list[ResponseExtractorField] = <factory>, GRANIAN_ACCESS_LEVEL: int = 30, GRANIAN_ERROR_LEVEL: int = 20)[source]¶
Bases:
object
Logger configuration.
- __init__(EXCLUDE_PATHS: str = '\\A(?!x)x', HTTP_EVENT: str = 'HTTP', INCLUDE_COMPRESSED_BODY: bool = False, LEVEL: int = <factory>, OBFUSCATE_COOKIES: set[str] = <factory>, OBFUSCATE_HEADERS: set[str] = <factory>, REQUEST_FIELDS: list[RequestExtractorField] = <factory>, RESPONSE_FIELDS: list[ResponseExtractorField] = <factory>, GRANIAN_ACCESS_LEVEL: int = 30, GRANIAN_ERROR_LEVEL: int = 20) None ¶
- REQUEST_FIELDS: list[RequestExtractorField]¶
Attributes of the `~litestar.connection.request.Request`_ to be logged.
- RESPONSE_FIELDS: list[ResponseExtractorField]¶
Attributes of the `~litestar.response.Response`_ to be logged.
- class app.config.settings.AppSettings(URL: str = <factory>, DEBUG: bool = <factory>, SECRET_KEY: str = <factory>, NAME: str = <factory>)[source]¶
Bases:
object
Application configuration.
- class app.config.settings.TemplateSettings(ENGINE: type[~litestar.contrib.jinja.JinjaTemplateEngine] = <class 'litestar.contrib.jinja.JinjaTemplateEngine'>)[source]¶
Bases:
object
Configures Templating for the project.
- __init__(ENGINE: type[~litestar.contrib.jinja.JinjaTemplateEngine] = <class 'litestar.contrib.jinja.JinjaTemplateEngine'>) None ¶
- ENGINE¶
Template engine to use. (Jinja2 or Mako)
alias of
JinjaTemplateEngine
- class app.config.settings.Settings(app: ~app.config.settings.AppSettings = <factory>, template: ~app.config.settings.TemplateSettings = <factory>, vite: ~app.config.settings.ViteSettings = <factory>, server: ~app.config.settings.ServerSettings = <factory>, log: ~app.config.settings.LogSettings = <factory>)[source]¶
Bases:
object
Application settings.