Skip to main content

Migration tool for old style “url” tags. “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.”

How it works

  • Finds all \*.html, \*.txt files.

  • Replaces all old style “url” tags.

  • Inserts {% load url from future %} when it’s needed.

Installation

$ pip install django-future-url

Usage

$ cd ~/projects/my_django_14_project/
$ future_url --verbose

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).

Options

You can use future_url --help for help.

Only shows changes to be made without actually modifying files:

$ future_url

Verbose output: $ future_url --verbose

Example

$ cat ./template1.html

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

$ cat ./template1.html

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

Tests

Install cram and run python setup.py test

Metadata

Release files for django-future-url 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-future-url 0.2
File Size Uploaded Provenance Actions
django-future-url-0.2.tar.gz 4.9 kB Without provenance Details for django-future-url-0.2.tar.gz

Release files / django-future-url-0.2.tar.gz

Download URL django-future-url-0.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9061207f066ff31c89f4c6c04c19667343168be0917a37b45b5786de7e9f065f
BLAKE2b-256 checksum
How to use checksums
37ccbed98140ecc8d28f8f51196d83b226623af7da464a26386e56ee578c6309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-future-url 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page