How do I check if a variable is False using Django template syntax?
{% if myvar == False %}
Doesn\'t seem to work.
You could write a custom template filter to do this in a half-dozen lines of code:
from django.template import Library
register = Library()
@register.filter
def is_false(arg):
return arg is False
Then in your template:
{% if myvar|is_false %}...{% endif %}
Of course, you could make that template tag much more generic... but this suits your needs specifically ;-)