Opened 8 years ago

Closed 8 years ago

#7926 closed (invalid)

'NoneType' object is not iterable

Reported by: tobi Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: NoneType, mod_python
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 8 years ago by Malcolm Tredinnick

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).

comment:2 Changed 8 years ago by tobi

PythonOption django.root /

was the problem. Removing this line from http.conf fixed it.
Thanks for your fast answer.

comment:3 Changed 8 years ago by Malcolm Tredinnick

Resolution: invalid
Status: newclosed

comment:4 Changed 8 years ago by Killarny

Component: HTTP handlingDocumentation
Needs documentation: set
Resolution: invalid
Status: closedreopened

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 Changed 8 years ago by Jacob

Resolution: invalid
Status: reopenedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top