{% ifequal %} Tag

Removed. Use {% if a == b %} instead.

Logic As Markdown

Argument(s)
values to compare.
Closing tag
Required — {% endifequal %}
Availability
Deprecated in Django 3.1 Removed in Django 4.0

Documentation

The ifequal tag compared two values and displayed the contents of the block if they were equal.

Old Syntax (No Longer Works)

{% ifequal user.username "admin" %}
  Welcome, admin!
{% endifequal %}

New Syntax

{% if user.username == "admin" %}
  Welcome, admin!
{% endif %}

Commentary

This tag no longer exists. Use the if tag with the == operator instead.

More Logic Tags

All Logic Tags


Did we get something wrong? Is there a use case for the ifequal tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 2, 2026