Package cherrypy :: Module _cpwsgi :: Class CPWSGIApp
[hide private]
[frames] | no frames]

Class CPWSGIApp

source code

object --+
         |
        CPWSGIApp

A WSGI application object for a CherryPy Application.

Nested Classes [hide private]
  response_class
The class to instantiate and return as the next app in the WSGI chain.
Instance Methods [hide private]
 
__init__(self, cpapp, pipeline=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
tail(self, environ, start_response)
WSGI application callable for the actual CherryPy application.
source code
 
__call__(self, environ, start_response) source code
 
namespace_handler(self, k, v)
Config handler for the 'wsgi' namespace.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  pipeline = [('ExceptionTrapper', <class 'cherrypy._cpwsgi.Exce...
A list of (name, wsgiapp) pairs.
  head = None
Rather than nest all apps in the pipeline on each call, it's only done the first time, and the result is memoized into self.head.
  config = {}
A dict whose keys match names listed in the pipeline.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cpapp, pipeline=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

tail(self, environ, start_response)

source code 

WSGI application callable for the actual CherryPy application.

You probably shouldn't call this; call self.__call__ instead, so that any WSGI middleware in self.pipeline can run first.


Class Variable Details [hide private]

pipeline

A list of (name, wsgiapp) pairs. Each 'wsgiapp' MUST be a constructor that takes an initial, positional 'nextapp' argument, plus optional keyword arguments, and returns a WSGI application (that takes environ and start_response arguments). The 'name' can be any you choose, and will correspond to keys in self.config.

Value:
[('ExceptionTrapper', <class 'cherrypy._cpwsgi.ExceptionTrapper'>),
 ('InternalRedirector', <class 'cherrypy._cpwsgi.InternalRedirector'>)\
]

head

Rather than nest all apps in the pipeline on each call, it's only done the first time, and the result is memoized into self.head. Set this to None again if you change self.pipeline after calling self.

Value:
None

config

A dict whose keys match names listed in the pipeline. Each value is a further dict which will be passed to the corresponding named WSGI callable (from the pipeline) as keyword arguments.

Value:
{}