Categories
How to check session and value in django template?
I want to check in the template whether there is a session with a key or not. How to do it?
Answer the question
In order to leave comments, you need to log in
{% if request.session.key_name %} ... {% endif %}
This is not done in the template.
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question