[Twisted-web] Nevow with CGI - Using URLs in xml templates

Tommi Virtanen tv at twistedmatrix.com
Mon Feb 14 05:42:02 MST 2005


Sridhar Ratna aka Srid wrote:
> Btw, for simplicity, I simply 'remember'ed the prefix URL in context.
> 
> prefix_url_from_config = http://server/cgi-bin/blog/index.py
> ctx.remember(prefix_url_from_config, IRootURL)
> 
> print url.URL.fromString(IRootURL(ctx)).child('foo').child('bar')
> http://server/cgi-bin/blog/index.py/foo/bar
> 
> That's it.

IMHO: Full URLs in configuration are Considered Harmful.

They prevent a lot of useful things like providing the same service
over HTTP and HTTPS.



More information about the Twisted-web mailing list