drums...@gmail.com
unread,Apr 18, 2009, 1:43:22 AM4/18/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
I wrote a replacement for 'flup' to attach Django to IIS7 FastCGI. My
WSGI handler works OK with non-Django applications, but when I use
WSGIHandler from Django, I cannot resolve any URL under the root.
Problem, I believe, is in the following code:
In WSGIRequest.__init__
...
if not path_info or path_info == script_name:
# Sometimes PATH_INFO exists, but is empty (e.g. accessing
# the SCRIPT_NAME URL without a trailing slash). We really
need to
# operate as if they'd requested '/'. Not amazingly nice
to force
# the path like this, but should be harmless.
#
# (The comparison of path_info to script_name is to work
around an
# apparent bug in flup 1.0.1. Se Django ticket #8490).
path_info = u'/'
self.environ = environ
self.path_info = path_info
self.path = '%s%s' % (script_name, path_info)
...
In my case script_name is the same as path_info. This code sets
path_info to '/', later it tries to resolve it agains my rules in
urls.py, and expectedly fails. Which results in 404 for anything under
the root Url. Here is the code:
In BaseHandler.get_response
...
try:
callback, callback_args, callback_kwargs = resolver.resolve
(
request.path_info)
...
Here request.path_info is '/', somehow code tries to resolve it, but
not request.path.
How should I set environment parameters or urls.py patterns to get
through this issue?
Thanks,
Sergei