server.config ============= .. py:module:: server.config Classes ------- .. autoapisummary:: server.config.Config server.config.ApplicationConfig Module Contents --------------- .. py:class:: Config(configuration: dict[str, Any]) Represents the configuration of the server. .. py:attribute:: applications .. py:attribute:: mail_queues .. py:attribute:: logging .. py:method:: from_yaml_file(yaml_file: _typeshed.StrOrBytesPath) -> Self :classmethod: Load the given yaml file and return a new Configuration instance with the configuration values found in the yaml file. .. py:method:: from_yaml_string(yaml_string: str | bytes) -> Self :classmethod: Load the given yaml string and return a new Configuration instance with the configuration values found in the yaml string. .. py:class:: ApplicationConfig(configuration: dict[str, Any]) Represents an application config entry loaded from a dictionary like this:: { 'path': '/application', 'application': 'my.module.StaticApp', 'namespace': 'my-namespace' 'configuration': { 'my': 'custom', 'config': 'values' } } It may contain the following keys: :path: The path of the application is the prefix under which the application is running. For each path onegov.server loads and caches an application. Applications are basically WSGI containers that are run independently in the same process. See :class:`~.application.Application` for more. There are two types of applications, static applications without a wildcard (`*`) in their path and wildcard applications *with* a wildcard in their path. Static applications always have the same application_id (`ns/static`, if the path is `/static` and the namespace is `ns`). Wildcard applications have the application_id set to the wildcard part of the path: (`/wildcard/*` can result in an applicaiton_id of `ns/blog` if `/wildcard/blog` is opened and the namespace is `ns`). See also: :meth:`~.application.Application.set_application_id`. Nested paths are not supported. `/static` works and `/wildcard/*` works, but not `/static/site` or `/wildcard/site/*`. :application: The application class or string to an application class that inherits from :class:`~.application.Application`. If `application` is a string, the class it points to is loaded immediately. :namespace: Each application has a namespace that must be unique. It is used make the application_id unique. Dashes in the namespace are replaced by underscores. :configuration: A dictionary that is passed to the application once it is initialized. See :meth:`.application.Application.configure_application`. .. py:attribute:: __slots__ :value: ('_cfg',) .. py:attribute:: _cfg .. py:property:: path :type: str .. py:property:: namespace :type: str .. py:property:: application_class :type: type[server.application.Application] .. py:property:: configuration :type: dict[str, Any] .. py:property:: root :type: str The path without the wildcard such that `/app` and `/app/*` produce the same root (`/app`). .. py:property:: is_static :type: bool True if the application is static (has no '*' in the path).