Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Migration tool for old style “url” tags.
Python Perl
Branch: master

Merge pull request #8 from zokis/master

Add encoding argument
latest commit 13b9180d43
@coagulant coagulant authored
Failed to load latest commit information.
django_future_url add ENCODING args
.gitignore Expanded .gitignore
.travis.yml Another try with Travis
AUTHORS Python 3 support
CHANGELOG.rst Clarification for README
LICENCE Added licence (MIT), proper manifest Clarification for README
README.rst Use console_scripts entry point for automatic script creation.
tox.ini Separated testsuites



Migration tool for old style “url” tags in Django 1.3 & 1.4. Support for Django 1.5 in next version. “In Django 1.5, the behavior of the url template tag will change”

If you use old style url tags in django 1.4 you will see that: “DeprecationWarning: The syntax for the url template tag is changing. Load the url tag from the future tag library to start using the new behavior.”

The new library also drops support for the comma syntax for separating arguments to the url template tag.

In Django 1.5, the old behavior will be replaced with the behavior provided by the future tag library. Existing templates be migrated to use the new syntax.

How it works

  • Finds all \*.html, \*.txt files.
  • Replaces all old style “url” tags.
  • Inserts {% load url from future %} when it's needed.


$ pip install django-future-url


$ cd ~/projects/my_django_14_project/
$ future_url

It will show needed midification for all templates in directory “~/projects/my_django_14_project/” and subdirectories.:

$ future_url --write

It will modernize all your templates in place (see above).


You can use future_url --help for help.

Only shows changes to be made without actually modifying files:

$ future_url


$ cat ./template1.html

{% url arg arg2 %}
{%  url arg arg2 %}
{%url myapp:view-name %}
{% url as the_url%}
{% url arg arg2   as   the_url %}
{%url app_views.client}
$ future_url --write

$ cat ./template1.html

{% load url from future %}
{% url '' arg arg2 %}
{%  url '' arg arg2 %}
{%url 'myapp:view-name' %}
{% url '' as the_url%}
{% url   '' arg arg2   as   the_url %}


Install python test and cram django_future_url/test/cram

Something went wrong with that request. Please try again.