Django: accessing session variables from within a template?
- by AP257
Hi all
If I set a session variable in Django, like:
request.session["name"] = "name"
Is there a way I can access it from within a template, or do I have to retrieve it from within a view, and then pass it to a template?
Asking because I have around 10 little session variables that I'd like to access within a template, and passing all 10 from the view to the template could get a bit messy.
(I have to use session variables because it's a HttpResponseRedirect, but storing the variables in a database is overkill for my purposes.)
So - any way to grab session variables directly within a template?