[mod_python] How to get path from URL

Graham Dumpleton grahamd at dscpl.com.au
Sun Feb 27 03:35:03 EST 2005


On 27/02/2005, at 6:54 PM, Gerald Lee wrote:

> The url is: http://localhost/ebiz/admin/index.py/index
> I can get string "http://localhost/ebiz/admin/", who can help me?

Closest you will get is "req.uri". It will not have "http://localhost" 
on
it and will also have "index.py/index". You can though use 
"req.path_info"
to work out how much to strip off the end.

Read through the documentation on the request object for additional 
info.

Graham



More information about the Mod_python mailing list