[Twisted-Python] HTTP 302 instead of just delivering the content.

Markus Schiltknecht markus at bluegap.ch
Tue Sep 12 08:51:46 MDT 2006


David Reid wrote:
> Nevow has a VHostMonster.

Yes. So?

>> webroot = Website('sites')
>> webroot.putChild('xxxxxx.ch', root)
>> webroot.putChild('www.xxxxxx.ch', root)
> 
> What do you expect this to do?

the same as root.addHost() in the twisted VHostMonster.

> See:
> http://twistedmatrix.com/projects/web/documentation/howto/using-twistedweb.html#auto21
> The usage is exactly the same for Nevow's VHostMonster.

Hm.. I've tried that but didn't manage to get twisted to correctly 
answer HTTP requests anymore. Thus I've been googling and figured out, 
that Nevow didn't work well with the VHostMonster and thus provides it's 
own.

Anyway, the code in the docu is:

root = vhost.NameVirtualHost()
root.addHost(vhostName, reverseProxy)
site = server.Site(root)
application = service.Application('web-proxy')
sc = service.IServiceCollection(application)
i = internet.TCPServer(80, site)
i.setServiceParent(sc)

Now, I don't have a reverseProxy, but a NevowSite(). Unfortunately 
that's a 'Site' and not a 'Resource' (whatever the exact difference is).

> It's an issue of URL generation from the request object.

Where does twisted need to generate a URL? I'm even mostly using 
relative links, AFAICR...

Regards

Markus




More information about the Twisted-Python mailing list