Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

To mask django url paths, instead of built in template tag

Project Description

Masking url’s on templates not to show exact path, hiding them all except get params.


pip install django-maskurl

Then add <code>maskurl.middleware.UnMaskURLMiddleware</code> to the end of your <code>MIDDLEWARE_CLASSES</code>.



To mask a url on a template simply at the top, before all html codes <code>{% load maskurl %}</code> line must be placed, as following;

{% load maskurl %}

Then requested urls on that html file should be one of the following formats;

- {% url 'main' %}
- {% url 'list' 4 %}
- {% url 'list' 'blah' %}
- {% url 'list' %}
- {% url 'list' %}
- {% url 'list'|title|lower %}
- {{ reversed_url }}

Those can be converted as following;

- {% maskurl 'main' %}
- {% maskurl 'main' 4 %}
- {% maskurl 'main' 'blah' %}
- {% maskurl 'main' %}
- {% maskurl 'main' %}
- {% maskurl 'main'|title|lower %}
- {% maskurl reversed_url %}

get params can also be added after the closing curly bracket.

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(9.9 kB) Copy SHA256 Hash SHA256
Source None Oct 8, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting