t.w.w.WSGIResource(object) : class documentation

Part of twisted.web2.wsgi View Source View In Hierarchy

Implements interfaces: twisted.web2.iweb.IResource

A web2 Resource which wraps the given WSGI application callable.

The WSGI application will be called in a separate thread (using the reactor threadpool) whenever a request for this resource or any lower part of the url hierarchy is received.
Method __init__ Undocumented
Method renderHTTP Return an IResponse or a deferred which will fire an IResponse. This response will be written to the web browser which initiated the request.
Method locateChild Locate another object which can be adapted to IResource.
def __init__(self, application): (source)
Undocumented
def renderHTTP(self, req): (source)
Return an IResponse or a deferred which will fire an IResponse. This response will be written to the web browser which initiated the request.
def locateChild(self, request, segments): (source)
Locate another object which can be adapted to IResource.
Returns

A 2-tuple of (resource, remaining-path-segments), or a deferred which will fire the above.

Causes the object publishing machinery to continue on with specified resource and segments, calling the appropriate method on the specified resource.

If you return (self, server.StopTraversal), this instructs web2 to immediately stop the lookup stage, and switch to the rendering stage, leaving the remaining path alone for your render function to handle.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:17:34.