repoze.tempita Overview 'repoze.tempita' is a middleware egress filter which conditionally causes the body returned by the application to be run through the "Tempita":http://pythonpaste.org/tempita/ templating engine, using replacement values defined within the 'repoze.tempita' Paste middleware configuration. Configuration In your paste.deploy .ini file, you can put 'repoze.tempita' into the pipeline by first configuring it within an app_filter section:: [filter:tempita] use = egg:repoze.tempita#tempita content-types = text/ application/text+xml repl.foo = foo repl.bar = bar The 'use' option is paste.deploy-specific and specifies that this filter should use the tempita middleware constructor. The 'content-types' option specifies HTTP content type *prefixes*. It is composed of a space-separated list of content-type prefixes. If the 'Content-Type' header set by a downstream application matches any of these prefixes, and a 'Content-Length' header is present, replacement will occur. They suffix and value of any option prefixed with 'repl.' will be placed into a dictionary, to be used by tempita as the replacements dictionary. To insert the configured filter into your pipeline, do, e.g.:: [pipeline:main] pipeline = tempita egg:MyApp#myapp Caveats 'repoze.tempita' does not respect the 'write' callable returned by the application's start_response. Data sent into 'write' is ignored when 'repoze.tempita' is in the middleware pipeline. 'repoze.tempita' does not currently work with applications that perform non-default HTTP content-encoding. 'repoze.tempita' does not allow anything but simple string replacements currently (no integer values, no lists, etc), although Tempita supports all of these things.