python - Access sessions in Template using Django 1.1.4 -


i have created session in view. have called in template. throws error stating invalid syntax. have checked settings.py , under middleware_classes session enabled. when ever run page throws error. please see below

views.py

request.session["name"] = "name" return render_to_response('index.html',context_instance = requestcontext(request,{'session':'name'}) 

index.html

{{ request.session.name }} 

if posted code correctly missing closing parentheses render_to_response

return render_to_response('index.html',context_instance = requestcontext(request,{'session':'name'}))


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -