Discussion:
'WSGIRequest' object has no attribute 'session'
为爱而生
2008-11-09 05:36:19 UTC
Permalink
Hi,all.
I often meet this problem recently while I run the django project.
How to fix it? Thanks.

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py",
line 277, in run
self.result = application(self.environ, self.start_response)

File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py",
line 634, in __call__
return self.application(environ, start_response)

File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py",
line 243, in __call__
response = middleware_method(request, response)

File "C:\django_toolbar\debug_toolbar\middleware.py", line 83, in
process_response

File "C:\django_toolbar\debug_toolbar\middleware.py", line 39, in show_toolbar

File "/usr/lib/python2.5/site-packages/django/contrib/auth/middleware.py",
line 5, in __get__
request._cached_user = get_user(request)

File "/usr/lib/python2.5/site-packages/django/contrib/auth/__init__.py",
line 83, in get_user
user_id = request.session[SESSION_KEY]

AttributeError: 'WSGIRequest' object has no attribute 'session'
--
"OpenBookProject"-匀攟囟乊计划邮件列衚
诊情: http://groups.google.com/group/OpenBookProject
绎基: http://wiki.woodpecker.org.cn/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Raja
2008-11-09 12:22:16 UTC
Permalink
Can you check if ur settings.py has
django.contrib.sessions.middleware.SessionMiddleware before
django.contrib.sessions.middleware.SessionMiddleware ?

-- Raja
Post by 为爱而生
Hi,all.
I often meet this problem recently while I run the django project.
How to fix it? Thanks.
File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py",
line 277, in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py",
line 634, in __call__
return self.application(environ, start_response)
File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py",
line 243, in __call__
response = middleware_method(request, response)
File "C:\django_toolbar\debug_toolbar\middleware.py", line 83, in
process_response
File "C:\django_toolbar\debug_toolbar\middleware.py", line 39, in show_toolbar
File "/usr/lib/python2.5/site-packages/django/contrib/auth/middleware.py",
line 5, in __get__
request._cached_user = get_user(request)
File "/usr/lib/python2.5/site-packages/django/contrib/auth/__init__.py",
line 83, in get_user
user_id = request.session[SESSION_KEY]
AttributeError: 'WSGIRequest' object has no attribute 'session'
--
"OpenBookProject"-开放图书计划邮件列表
详情:http://groups.google.com/group/OpenBookProject
维基:http://wiki.woodpecker.org.cn/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...