Opened 18 years ago
Closed 17 years ago
#2833 closed defect (duplicate)
Request.context tries to access user when there's no session causing traceback
Reported by: | Filipe | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When using django without a database one will have to explicitly include TEMPLATE_CONTEXT_PROCESSORS in settings.py (as a workaround) in order to remove 'django.core.context_processors.auth'. Otherwise, when having DEBUG=False in settings.py, tracebacks will be displayed whenever HTTP 404s happen, instead of the expected 404.html template.
Please refer to this thread:
http://groups.google.com/group/django-users/browse_frm/thread/2dc05239c27c8a06/b640aa4f26f2d434
Attachments (2)
Change History (6)
comment:1 by , 18 years ago
Component: | Admin interface → Core framework |
---|
comment:2 by , 18 years ago
Summary: | Context_processors.auth when there's no session → Request.context tries to access user when there's no session causing traceback |
---|---|
Triage Stage: | Unreviewed → Accepted |
Malcolm Tredinnick's explanation:
OK, this is the problem line: RequestContext tries to access "user". The reason we are using RequestContext is because of ticket #688 (which is quite a reasonable change). However, we have to conditionally avoid this user requirement.
by , 17 years ago
Attachment: | auth_context_processors_fix.diff added |
---|
comment:3 by , 17 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Version: | → SVN |
If request doesnt have user attribute then it returns empty dictionary.
corrected component