Titus Brown wrote:
-> I use relative URLs because of this, but I understand why this might
-> cause you problems.  Perhaps we can add a 'root namespace' parameter
-> to WSGI...

duh.

That's what SCRIPT_NAME is.

BTW, an interesting (I think) pattern that I found, with a hook I added to wsgikit.urlparser which calls __init__.urlparser_hook(environ) when it's parsing the URL. In the root of an "application", I do something like:


def urlparser_hook(environ):
    if 'todo.base_url' not in environ:
        environ['todo.base_url'] = environ['SCRIPT_NAME']

This way as urlparser continues its parsing I keep a kind of bookmark to the state of SCRIPT_NAME.

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to