Is boolean logic possible in django templates?
Django docs on boolean operators
Gives you:
{% if user in users %} If users is a QuerySet, this will appear if user is an instance that belongs to the QuerySet.{% endif %}
and
{% if a == b or c == d and e %}
Be aware that and
has a higher order of precedence than or
, and that parentheses are not possible. If required use nested blocks.