django_maskurl
Masking url’s on templates not to show exact path, hiding them all except get params.
Installing
pip install django-maskurl
Then add <code>maskurl.middleware.UnMaskURLMiddleware</code> to the end of your <code>MIDDLEWARE_CLASSES</code>.
MIDDLEWARE_CLASSES = (
'dikeyshop.syncer.middlewares.SyncerMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
...
'maskurl.middleware.UnMaskURLMiddleware',
)
Usage
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 %}
<title>...
...
Then requested urls on that html file should be one of the following formats;
- {% url 'main' %}
- {% url 'list' 4 %}
- {% url 'list' 'blah' %}
- {% url 'list' object.id %}
- {% url 'list' obj1.id obj2.id %}
- {% url 'list' obj1.name|title obj2.id|lower %}
- {{ reversed_url }}
Those can be converted as following;
- {% maskurl 'main' %}
- {% maskurl 'main' 4 %}
- {% maskurl 'main' 'blah' %}
- {% maskurl 'main' object.id %}
- {% maskurl 'main' obj1.id obj2.id %}
- {% maskurl 'main' obj1.id|title obj2.id|lower %}
- {% maskurl reversed_url %}
get params can also be added after the closing curly bracket.
Metadata
Release files for django-maskurl 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-maskurl-0.1.tar.gz | 9.9 kB | Without provenance | Details for django-maskurl-0.1.tar.gz |
Release files / django-maskurl-0.1.tar.gz
| Download URL | django-maskurl-0.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a437590e53376f86f0cc44e0b37349bc0359faf85961c7113465158815fc5c8
|
|
BLAKE2b-256 checksum How to use checksums |
eb2656cfd13453211b8e47d5a2093c54808e520e158bd88baea63dd236836747
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-maskurl 0.1
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.