Package cherrypy :: Module _cpdispatch
[hide private]
[frames] | no frames]

Module _cpdispatch

source code

CherryPy dispatchers.

A 'dispatcher' is the object which looks up the 'page handler' callable and collects config for the current request based on the path_info, other request attributes, and the application architecture. The core calls the dispatcher as early as possible, passing it a 'path_info' argument.

The default dispatcher discovers the page handler by matching path_info to a hierarchical arrangement of objects, starting at request.app.root.

Classes [hide private]
  PageHandler
Callable which sets response.body.
  LateParamPageHandler
When passing cherrypy.request.params to the page handler, we do not want to capture that dict too early; we want to give tools like the decoding tool a chance to modify the params dict in-between the lookup of the handler and the actual calling of the handler.
  Dispatcher
CherryPy Dispatcher which walks a tree of objects to find a handler.
  MethodDispatcher
Additional dispatch based on cherrypy.request.method.upper().
  WSGIEnvProxy
  RoutesDispatcher
A Routes based dispatcher for CherryPy.
Functions [hide private]
 
XMLRPCDispatcher(next_dispatcher=Dispatcher()) source code
 
VirtualHost(next_dispatcher=Dispatcher(), use_x_forwarded_host=True, **domains)
Select a different handler based on the Host header.
source code
Variables [hide private]
  __package__ = 'cherrypy'
Function Details [hide private]

VirtualHost(next_dispatcher=Dispatcher(), use_x_forwarded_host=True, **domains)

source code 

Select a different handler based on the Host header.

Useful when running multiple sites within one CP server.

From http://groups.google.com/group/cherrypy-users/browse_thread/thread/f393540fe278e54d:

For various reasons I need several domains to point to different parts of a single website structure as well as to their own "homepage" EG

http://www.mydom1.com -> root http://www.mydom2.com -> root/mydom2/ http://www.mydom3.com -> root/mydom3/ http://www.mydom4.com -> under construction page

but also to have http://www.mydom1.com/mydom2/ etc to be valid pages in their own right.