First time here? Check out the FAQ!

Revision history  [back]

'WSGIRequest' object has no attribute 'session' - error trying to integrate askbot with our own django app

Currently getting the following error when moving between askbot pages and our own django app:

'WSGIRequest' object has no attribute 'session'

with traceback ending at

/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/contrib/auth/__init__.py in get_user
    107.     user_id = request.session[SESSION_KEY]

Suspect this is because askbot is using different session middleware to our own - any ideas?

Minimal repro is: go to askbot section of our site (not logged in), click on "log in" link.

here is our MIDDLEWARE_CLASSES from settings.py:

('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware')

as far as I can tell, this is merged correctly with the askbot settings.py...

'WSGIRequest' object has no attribute 'session' - error trying to integrate askbot with our own django app

Currently getting the following error when moving between askbot pages and our own django app:

'WSGIRequest' object has no attribute 'session'

with traceback ending at

/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/contrib/auth/__init__.py in get_user
    107.     user_id = request.session[SESSION_KEY]

Suspect this is because askbot is using different session middleware to our own - any ideas?

Minimal repro is: go to askbot section of our site (not logged in), click on "log in" link.

here is our MIDDLEWARE_CLASSES from settings.py:

('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware')

as far as I can tell, this is merged correctly with the askbot settings.py...