django-urlalternatives - Alternative Django views under same URL pattern
Django URL alternatives provides a way for dispatching one URL pattern to the first alternative view (callback function) in a list that returns success.
- version:
0.1 (or corresponding Mercurial revision hash)
- web:
- author:
- license:
GPLv3+
- keywords:
url alternatives, dispatcher, views, django, urlconf, same pattern
Description
In case you want to assing in an URLconf the same URL pattern to more than one view (or callback function), such that the next ones are fallbacks in case of errors (ie. HTTP response codes >= 400). This is often the case when combining different apps with dynamic URLs (such as CMSs) and you want to respond with the one that has that content.
Usage
As you can see from the following example the URL alternatives dispatcher is simply used as part of the urlpatterns variable in urls.py and supports passing of positional and keyword arguments, eg.:
- urlpatterns += pattern(‘’,
- (r’^’, ‘urlalternatives.views.dispatcher’, {‘callbacks’:[
app1.views.failing404, ‘app2.views.working’, (redirect_to, [], {‘url’:’/’}),
]}),
)
Metadata
Release files for django-urlalternatives 0.1.0
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-urlalternatives-0.1.0.tar.gz | 15.0 kB | Without provenance | Details for django-urlalternatives-0.1.0.tar.gz |
Release files / django-urlalternatives-0.1.0.tar.gz
| Download URL | django-urlalternatives-0.1.0.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b53a74fed5389abbdc3923a228d04d6f4f1ad952a7d3196863a4171ebfec1523
|
|
BLAKE2b-256 checksum How to use checksums |
09e6afa9dd9111527fe36efa7b34f95daa4f7dc82df50ad02f83c47887967fa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-urlalternatives 0.1.0
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.