[Twisted-web] NameVirtualHost

Alex Newby alex at alexnewby.com
Sat Jun 19 19:39:08 MDT 2004


I'm a stumped newbie. I've adapted the moin_twisted.py script for
MoinMoin on localhost on WinXP Python2.3.3 to use the Nevow vhost module
instead of from twisted.web, and from twisted.application import
internet, service and replaced the call to app.Application as follows. 

#application = app.Application("web")
#application.listenTCP(httpd_port, site, interface=httpd_host)

application = service.Application('web')
sc = service.IServiceCollection(application)
site = server.Site(root)
i = internet.TCPServer(8001, site)

I am using mod_rewrite behind apache. Twisted handles localhost requests
passed from Apache for, no problem, but the remote
server gives the error.

/usr/local/lib/python2.3/site-packages/twisted/web/resource.py, line 59
in getChildForRequest
57def getChildForRequest(resource, request):
58  """Traverse resource tree to find who will handle the request."""
59  while request.postpath and not resource.isLeaf:
60    pathElement = request.postpath.pop(0)
exceptions.AttributeError: 'NameVirtualHost' object has no attribute

Alex Newby 
E-mail: alex at alexnewby.com
Website: http://www.alexnewby.com

More information about the Twisted-web mailing list