[BangPypers] Acessing session variables in template with django

Puneet Aggarwal look4puneet at gmail.com
Sat May 23 07:33:26 CEST 2009

Hi All,

I am facing issue when I am trying to access session variables in django.

I am setting the session variable something like :

 request.session['cityname'] = cityname
 c = RequestContext(request, {'current_date': now})
 html = t.render(c)
 return HttpResponse(html)

And I am trying to access it like :

{{ request.session.cityname }}
{{ request.cityname }}

But it does not seem to be working. Any suggestions ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090523/3c46f9e5/attachment.htm>

More information about the BangPypers mailing list