HTTP request and response¶
Websauna uses Pyramid’s request processing.
Request and response¶
The incoming HTTP request is an instance of
When your view function returns
If the return value is instance of
pyramid.response.Responseit is processed as is
If the return value is a dictionary, as usually it is to pass template context variables to template rendering, a corresponding renderer is invoked to turn the context to a response. The
rendererargument to view configuration is a template name. The template engine loads this template and passes the view return value to it as template context.
Routing to a corresponding view function or class is done by Pyramid’s routing mechanism (URL dispatch <http://docs.pylonsproject.org/projects/pyramid//en/latest/narr/urldispatch.html>, traversal). You set up this in Initializer.
Related methods include