Edit me on GitHub

pylons.util – Paste Template and Pylons utility functions

Paste Template and Pylons utility functions

PylonsTemplate is a Paste Template sub-class that configures the source directory and default plug-ins for a new Pylons project. The minimal template a more minimal template with less additional directories and layout.

Module Contents

class pylons.util.PylonsContext

Pylons context object

All the Pylons Stacked Object Proxies are also stored here, for use in generators and async based operation where the globals can’t be used.

This object is attached in WSGIController instances as _py_object. For example:

class MyController(WSGIController):
    def index(self):
        pyobj = self._py_object
        return "Environ is %s" % pyobj.request.environ
class pylons.util.ContextObj

The tmpl_context object, with strict attribute access (raises an Exception when the attribute does not exist)

class pylons.util.AttribSafeContextObj

The tmpl_context object, with lax attribute access ( returns ‘’ when the attribute does not exist)

Table Of Contents

Previous topic

pylons.test – Test related functionality

Next topic

pylons.wsgiapp – PylonsWSGI App Creator