[Twisted-Python] [Twisted.Web] How to access root resource without .rpy file?

Stuart Hungerford stuart.hungerford at anu.edu.au
Sun May 11 21:23:30 MDT 2003


Hi all,

Apologies if this is an FAQ -- I'm still working my way through the
documentation and mailing list postings.

I have a Twisted.Web server serving resources from a directory
called "project" say at the (example) URL:

      http://example.org:8080/project

Later I plan to offer URL's at that address like:

      http://example.org:8080/project/service1
      http://example.org:8080/project/service2?param=1

I understand that each component of a URL is handled as a Twisted
web "resource" with various methods for accessing other components
in the URL and controlling rendering to HTML.

How can I get Python access to the root resource here (in my
case "project") when the URL is first processed by Twisted.Web?

I understand that I could create a project.rpy file which creates
a resource but I need to use the unadorned resource names above
rather than http://example.org:8080/project/project.rpy

Any advice much appreciated,


Cheers,

Stu

--
:: Stuart Hungerford (stuart.hungerford at anu.edu.au)
:: ANU Internet Futures Group





More information about the Twisted-Python mailing list