{% ifnotequal %} Tag

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

Logic As Markdown

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

Documentation

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

Old Syntax (No Longer Works)

{% ifnotequal user.username "admin" %}
  You are not the admin.
{% endifnotequal %}

New Syntax

{% if user.username != "admin" %}
  You are not the 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 ifnotequal tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 2, 2026