[Twisted-web] Nevow with CGI - Using URLs in xml templates
Sridhar Ratna aka Srid
sridharinfinity at gmail.com
Sun Feb 13 04:51:38 MST 2005
I am using  Nevow in CGI environment
Both relative and absolute URLs cannnot be used in xml templates.
Consider the following apache setup.
http://server/blog is rewritten (mod_rewrite) to
Now if an xml template contains this line
<link rel="stylesheet" href="styles/screen.css" type="text/css" />
without rewrite the URL the browser will see is
and with rewritten the browser will see http://server/blog/styles/screen.css
This depends on the current page, so sometimes the browser will see
http://server/blog/2004/04/styles/screen.css (as the URL is relative).
To cope with this problem with url.URL generation, I remember the
parent-root URL in ctx. But I feel this is difficult to do with
xml-templates as they are controlled by the user. Is there anyway to
do translation in nevow?
Sridhar Ratna - http://srid.bsdnerds.org
More information about the Twisted-web