This project is archived. It is no longer updated or maintained.
Django-urldecorators is a reusable Django application which allows apply view decorators and middleware components based on a requested URL.
This library is compatible with Django 1.4 and later. If you need to use older Django versions (which receive no security updates or bugfixes) you can install 0.4 version of django-urldecorators.
Installation and usage
Run python setup.py install or add the urldecorators module to your PYTHONPATH (or use pip or easy_install).
In urls.py file replace from django.conf.urls import url, include by from urldecorators import url, include
Pass a list of decorators and/or middleware_classes as an argument to the url function.
Example urls.py file:
from urldecorators import url, include
urlpatterns = [
url(r'^private/$', include('example.private.urls'),
decorators=['django.contrib.auth.decorators.login_required']),
url(r'^articles/$', include('example.articles.urls'),
middleware_classes=['django.middleware.cache.CacheMiddleware']),
]
For the example configuration and usage see the example project included in the repository. It can be run using django-admin.py utility from the repository root:
$ django-admin.py syncdb --settings=example.settings --pythonpath="$PWD" $ django-admin.py createsuperuser --settings=example.settings --pythonpath="$PWD" $ django-admin.py runserver --settings=example.settings --pythonpath="$PWD"
Requirements
Django-urldecorators is tested with Django versions from 1.4 to 1.11 but it does not support patterns function from ancient Django versions.
Both Python 2 and Python 3 are supported.
Testing
Application tests can run using tox:
$ tox
Metadata
Release files for django-urldecorators 0.7
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 | |
|---|---|---|---|---|
| django-urldecorators-0.7.tar.gz | 10.2 kB | Without provenance | Details |
Release files / django-urldecorators-0.7.tar.gz
| Download URL | django-urldecorators-0.7.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a0f15ea2cf331c5d02065ceb22bf4df896ad50eab9c7efc8512dd25999dd28b
|
|
BLAKE2b-256 checksum How to use checksums |
96daaf037bca0a4eaeed0a132d342227744cc2c78c3c0959e89b286dd6049e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.1
|
Security for django-urldecorators 0.7
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.