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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…