election_day.app
Classes
The election day application. Include this in your onegov.yml to serve |
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents
- class election_day.app.ElectionDayApp[source]
Bases:
onegov.core.Framework
,onegov.form.FormApp
,onegov.user.UserApp
,onegov.file.DepotApp
The election day application. Include this in your onegov.yml to serve it with onegov-server.
- serve_static_files = True[source]
Returns True if
/static
files should be served. Needs to be enabled manually.Note that even if the static files are not served,
/static
path is still served, it just won’t return anything but a 404.Note also that static files are served publicly. You can override this in your application, but doing that and testing for it is on you!
See also:
onegov.core.static
.
- request_class[source]
The class of the Request to create. Must be a subclass of
morepath.Request
.By default the request class is
morepath.Request
- property principal: Canton | Municipality[source]
Returns the principal of the election day app. See
onegov.election_day.models.principal.Principal
.
- load_principal() Canton | Municipality | None [source]
The principal is defined in the
principal.yml
file stored on the applications filestorage root.If the file does not exist, the site root does not exist and therefore a 404 is returned.
The structure of the yaml file is defined in class:onegov.election_app.model.Principal.
- election_day.app.org_content_security_policy() more.content_security.ContentSecurityPolicy [source]
- election_day.app.enable_iframes_and_analytics_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response] [source]
- election_day.app.override_language_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response] [source]
- election_day.app.cache_control_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response] [source]
- election_day.app.micro_cache_anonymous_pages_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response] [source]