Reputation: 81
How to add correctly in my example {% url 'myview' %}
{% if request.path == {% url 'myview' %} %}
?
Upvotes: 8
Views: 4734
Reputation: 474161
Django has this nice built-in feature that you can assign the url to a variable and then use it:
{% url 'myview' as my_view %}
{% if request.path == my_view %}
Upvotes: 17