WSGI Plone Paste Config
Notes about the python Paste configuration for the devel build of Plone with WSGI using Martin Aspelli's Plone 3.x Uber-Buildout
here the python paste configuration for the devel build of the PloneWithWSGI plone built using Martin Aspelli's Plone3.x-repoze uber-buildout buildout. the Plone With WSGI understanding the deliverance/plone theme composition section is concerned with that configuration.
here are some relevant general paste details distilled from the paste deploy documentation:
the sections of the file define applications for handling requests and filters, for use in the applications, to be applied to requests along the way.
the elements are generally specified as python application packages called eggs. (eggs in paste describes how eggs are used in the paste .ini configs. the python package index is the central network provider of information about and automatic vending of eggs.)
here are the various section types, to the degree that i understand them:
Type | Purpose |
---|---|
app | a program designed to cooperate in the WSGI style |
composite | an application made up of other applications; with a criterion that selects among the according to a condition |
filter | a program that modifies a request before it is is sent to an application, to be used in application definitions via a filter-with = andpipeline = settings in application sections |
filter-app | a filter definition which specifies the application to which the filter is applied |
pipeline | a filter-app composed of a sequence of filters |
server | i'm unclear about this. it seems to be an application that is run as a server |
in our configuration, the bottom two :main sections define a server that uses a pipeline composed, directly or indirectly, of the elements defined in prior sections of the file.
going more or less from bottom to top:
- defines a paste http server, using the Paste package's httpobject/application - use = egg:Paste#http. parameters passed to the application are indicated by the other lines in the section. if you want the created server to be reached off-host
- adds a WSGI pipeline to the main server which consists of:
- based on the collective.fourohfour egg handler entry point for forwarding web responses over the WSGI pipeline to pages in plone.
- egg:Paste#httpexceptions - the httpexceptions entry point of
- the use = ... makes this composite a "url mapper" (`Paste.urlmap`_), which effectively dispatches requests to specified applications depending on the request's path and domain.
- constituted by a few repoze egg elements, an error log filter, and zope:
- middleware which implements retryable exceptions -http://pypi.python.org/pypi/repoze.retry
- zope-like transaction manager via WSGI -http://pypi.python.org/pypi/repoze.tm/1.0a5
- repoze virtual hosting middleware, translating special environment settings to standard CGI forms -http://pypi.python.org/pypi/repoze.vhm
- uses the repoze errorlog facility, via an egg
- a paste application constructed using the repoze.obob repoze component publisher. make_obob method, with parameters specified by the other lines in the section.
the repoze.obob is the pivotal repoze component - a configurable object publisher by which you define the elements of an application which maps request URLs to python objects via graph traversal. see developing with repoze.zope2 for the developer's original introduction.
:
- - here is the deliverance-egg based element, with a rule_filename parameter specifying the theme rules - located by default in theme/rules/default.xml relative to the build root.
- - another composite url mapper
in summary:
- the main pipeline includes the vhost composite, which maps some requests to the zope pipeline and some to the with-deliverance pipeline, depending on the request domain and path.
- the with-deliverance element is the front-end for most of the incoming requests, so deliverance can do its job to feed
- from there, some of the requests wind up in the zope2 machinery (which also directs requests to python objects, depending on the request path and other incidentals)
- in deliverance, fetching static html elements from the theme.