Re: Newbie question on handling args in URL string

Maarten ter Huurne <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.