#7871 closed (fixed)
No trailing slash in url causes TypeError with mod_wsgi
| Reported by: | Owned by: | Malcolm Tredinnick | |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
My Apache config includes the following line:
WSGIScriptAlias /testing /var/www/testing/django.wsgi
and my django.wsgi looks like this:
import os, sys
path = '/var/www'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'testing.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
http://example.com/testing/ displays correctly, but http://example.com/testing (without the trailing slash) produces the following error:
Traceback: File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response 78. request.path_info) Exception Type: TypeError at /testing Exception Value: 'NoneType' object is not iterable
Change History (5)
comment:1 by , 17 years ago
| Owner: | changed from to |
|---|
comment:2 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 17 years ago
If you can still reproduce this problem, please reopen, but it would be helpful if you could also print what Django thinks self.path and self.path_info are at that point in the process. I'm fairly sure [8032] is the sufficient, though (and shouldn't harm other cases).
Note:
See TracTickets
for help on using tickets.
Gaargh... I used to handle this and then I removed it to fix another bug (forgetting why it was there originally). When I fix it this time, it's definitely getting a comment! Thanks for the clear report.