Opened 19 years ago

Closed 19 years ago

#355 closed defect (invalid)

A bug in middleware/admin.py with ModPython handler

Reported by: mr_little Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: critical Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When /admin/ requested:

There's been an error:

Traceback (most recent call last):

  File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\core\handlers\base.py", line 60, in get_response
    response = middleware_method(request, callback, param_dict)

  File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\middleware\admin.py", line 49, in process_view
    return self.display_login_form(request, message)

  File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\middleware\admin.py", line 89, in display_login_form
    request.session.set_test_cookie()

AttributeError: 'ModPythonRequest' object has no attribute 'session'

dir(request):['COOKIES', 'FILES', 'GET', 'META', 'POST', 'REQUEST', 'class', 'delattr', 'dict', 'doc', 'getattribute', 'getitem', 'hash', 'init', 'module', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'str', 'weakref', '_files',
'_get_cookies', '_get_files', '_get_get', '_get_meta', '_get_post', '_get_raw_post_data', '_get_request', '_get_user', '_load_post_and_files', '_meta', '_post', '_raw_post_data', '_req', '_set_cookies', '_set_get', '_set_post', '_set_user', '_user', 'get_full_path', 'path', 'raw_post_data', 'user']

Change History (1)

comment:1 by mr_little, 19 years ago

Resolution: invalid
Status: newclosed

AssertionError: The admin requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.middleware.sessions.SessionMiddleware' before 'AdminUserRequired'.

:)

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