server.config
Classes
Represents the configuration of the server. |
|
Represents an application config entry loaded from a dictionary like |
Module Contents
- class server.config.Config(configuration: dict[str, Any])[source]
Represents the configuration of the server.
- class server.config.ApplicationConfig(configuration: dict[str, Any])[source]
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
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:
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
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
application.Application.configure_application()
.
- property application_class: type[server.application.Application][source]