18 Mar
2010
18 Mar
'10
6:05 p.m.
On Thursday 18 March 2010, Rob Newman wrote:
from twisted.web import server, static, rewrite from twisted.application import service, internet
root = resource.Root()
# Another file (resource.py) defines the resources Data() and Root()
root.putChild('data', resource.Data()) root.putChild('images', static.File(images_dir)) root.putChild('jquery', static.File(js_dir))
rewrite_root = rewrite.RewriterResource(root, pathToArgs)
site = server.Site(rewrite_root)
I think it's the rewriting that is complicating things. Why not handle both URL styles in the Data class? Even if you want to rewrite, you could avoid a lot of duplication by putting the RewriterResource under 'data' instead of in the root. Bye, Maarten