[Django]-Django: Supporting URL tag with quotes (>1.5) or without them (older Django versions)

4👍

Load the future version of the url tag in your template, then you can use the new syntax in Django 1.3 or 1.4 as well.

{% load url from future %}
{% url 'myapp.views.index' %}

Loading the URL tag from future is deprecated in Django 1.7, and removed in Django 1.9. Once you have upgraded production to 1.5 or greater, you can remove it from your templates.

Leave a comment