| Issue 89: | file based sessions are not stored in windows enviornment | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I am using windows XP and Python with django
1. changed the SESSION_ENGINE to 'django.contrib.sessions.backends.file'
2. SESSION_FILE_PATH = 'd:/tmp'
3. In view.py defined 2 methods/views as follows
def show_login(request):
request.session['test'] = "Hello World"
return render_to_response('login.html')
def form_submit(request):
return render_to_response('home.html', {'result' : request.session['test']})
On click of test button click from login.html it will call form_submit view.
It loads the login.html and also creates session file in d:/tmp but while
reading the session it throws following error on the browser
KeyError at /form_submit
stack trace
# C:\Python26\lib\site-packages\django\core\handlers\base.py in get_response
response = callback(request, *callback_args, **callback_kwargs)
# D:\PythonSample\mysite\..\mysite\portal\views.py in form_submit
return render_to_response('home.html', {'result' : request.session['test']})
# C:\Python26\lib\site-packages\django\contrib\sessions\backends\base.py in
__getitem__
return self._session[key]
I am using django version 1.1.1, OS Windows xp and python 2.6
Please let me know what is wrong here or are there any other changes need
to be done for file based session.
Apr 1, 2010
Project Member
#1
rwpoul...@gmail.com
Status:
Invalid
|