Opened 16 years ago
Closed 16 years ago
#7926 closed (invalid)
'NoneType' object is not iterable
Reported by: | tobi | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | NoneType, mod_python | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have Django trunk with Apache + mod_python.
While trying to access the admin page I got:
TypeError at /admin/ 'NoneType' object is not iterable ... PATH_INFO: u'admin/'
Now I changed django/core/handlers/modpython.py on Line 31 from:
self.path_info = force_unicode(req.uri[len(root):])
to:
self.path_info = "/" + force_unicode(req.uri[len(root):])
and everything works fine again.
Change History (5)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
PythonOption django.root /
was the problem. Removing this line from http.conf fixed it.
Thanks for your fast answer.
comment:3 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:4 by , 16 years ago
Component: | HTTP handling → Documentation |
---|---|
Needs documentation: | set |
Resolution: | invalid |
Status: | closed → reopened |
The documentation may need to be revised; I don't see where it is mentioned not to have a single / on the django.root. In fact, the current wording makes it very easy to make this mistake:
Quoted from How to use Django with mod_python:
The value set on that line (the last item) should match the string given in the <Location ...> directive.
comment:5 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Please don't reopen tickets closed by developers. In this case, if you'd like the documentation updated, please open another ticket instead of changing the goals of this one.
Looks like your
django.root
has a trailing slash on it, which is mentioned in the documentation as not the way to go.If that's not the case, please print out what
req.uri
is in that case. I can't immediately see why that should be happening and your fix isn't the right approach (it's symptom patching, not fixing the problem).