Class t.w.v.NameVirtualHost(resource.Resource):

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

Resource in charge of dispatching requests to other resources based on the value of the HTTP 'Host' header.
ParameterssupportNestedIf True domain segments will be chopped off until the TLD is reached or a matching virtual host is found. (In which case the child resource can do its own more specific virtual host lookup.)
Method __init__
Method addHost Add a host to this virtual host. - The Fun Stuff(TM)
Method removeHost Remove the given host.
Method locateChild It's a NameVirtualHost, do you know where your children are?

Inherited from Resource:

Method child_ This method locates a child with a trailing "/" in the URL.
Method putChild Register a static child.
Method http_GET Respond to a GET request.

Inherited from RenderMixin (via Resource):

Method allowedMethods
Method checkPreconditions Checks all preconditions imposed by this resource upon a request made
Method renderHTTP See iweb.IResource.renderHTTP.
Method http_OPTIONS Respond to a OPTIONS request.
Method http_TRACE Respond to a TRACE request.
Method http_HEAD Respond to a HEAD request.
Method render Subclasses should implement this method to do page rendering.
def __init__(self, default=None): (source)
ParametersdefaultThe default resource to be served when encountering an unknown hostname. (type: twisted.web2.iweb.IResource or None )
def addHost(self, name, resrc): (source)

Add a host to this virtual host. - The Fun Stuff(TM)

This associates a host named 'name' with a resource 'resrc':
   nvh.addHost('nevow.com', nevowDirectory)
   nvh.addHost('divmod.org', divmodDirectory)
   nvh.addHost('twistedmatrix.com', twistedMatrixDirectory)
I told you that was fun.
ParametersnameThe FQDN to be matched to the 'Host' header. (type: str )
resrcThe twisted.web2.iweb.IResource to be served as the given hostname.
resource(type: twisted.web2.iweb.IResource )
def removeHost(self, name): (source)
Remove the given host.
ParametersnameThe FQDN to remove. (type: str )
def locateChild(self, req, segments): (source)

It's a NameVirtualHost, do you know where your children are?

This uses locateChild magic so you don't have to mutate the request.
API Documentation for twisted, generated by pydoctor.