[Answer]-Django and condition in ifequal statement throws error

1👍

From django ifequal documentation

It is only possible to compare an argument to template variables or strings. You cannot check for equality with Python objects such as True or False. If you need to test if something is true or false, use the if tag instead.

So if you want to check for True or False, so need to use if.

{%if var1 == "google" and var2 %}
....
{%endif%}
👤Rohan

Leave a comment