Compare request.path with a reversed url in Django template
问题 I understand that request.path will give me the current URL. I am currently working on my base.html template with CSS tabs and I want the template to know which tab is currently "active" and pass class="active-tab" to an <a> tag. So I wanted to do something like <a href="{% url orders_list %}" {% if request.path = reverse('orders_list') %} class="active-tab" {$ endif %} >Orders</a> But I'm sure you can't do that if comparison. I also only want the base (?) URL ignoring any GET parameters. Any