Django middleware that makes urls ending with and without slashes equivalent
When using [DRF](https://www.django-rest-framework.org) routers you have a choice to either have urls end with trailing slash (default) or not.
i.e `DefaultRouter(trailing_slash=False)`. You can't however have it both ways, as in ignore them.
This package defines a very simple middleware class that removes trailing slashes from urls if they have one.
So in order to ignore trailing slashes and have `/api/some_url` be equivalent to `/api/some_url/` simply install the package and add the middleware class as the first entry in the MIDDLEWARE list. Please note that middleware [changed in django 1.10](https://docs.djangoproject.com/en/1.10/topics/http/middleware/) and this this pacakge requires django version >= 1.10.
```python
MIDDLEWARE = [
# Should be first entry
'drf_ignore_slash_middleware.SlashIgnoreMiddleware',
# Rest of your middleware
]
```
Metadata
Release files for drf-ignore-slash-middleware 0.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 |
|---|---|---|---|---|
| drf_ignore_slash_middleware-0.0.1.tar.gz | 1.9 kB | Without provenance | Details for drf_ignore_slash_middleware-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| drf_ignore_slash_middleware-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for drf_ignore_slash_middleware-0.0.1-py3-none-any.whl |
Total release size: 5.9 kB
Release files / drf_ignore_slash_middleware-0.0.1.tar.gz
| Download URL | drf_ignore_slash_middleware-0.0.1.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ed51accc471b44c8e7986e3667669f74e7fa303a516f774d7931d069c1d6f0d
|
|
BLAKE2b-256 checksum How to use checksums |
a10800ecbea7817303fde854a44e8455a64f138aaceb4de811c3464dcec91ba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / drf_ignore_slash_middleware-0.0.1-py3-none-any.whl
| Download URL | drf_ignore_slash_middleware-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c17b6c2ce16685455df4be0fe7d34c5f6fa4c61ddb4660ca5f253ea08914469
|
|
BLAKE2b-256 checksum How to use checksums |
403da019e71fe3cf296efe06a7fd0c3e0de222624e55e305f4b15028f618b93d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for drf-ignore-slash-middleware 0.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.