Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Django middleware that makes urls ending with and without slashes equivelent

Project description

# drf-ignore-slash-middleware
Django middleware that makes urls ending with and without slashes equivalent

When using [DRF]( 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]( and this this pacakge requires django version >= 1.10.

# Should be first entry
# Rest of your middleware

Project details

Release history Release notifications

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
drf_ignore_slash_middleware-0.0.1-py3-none-any.whl (4.0 kB) Copy SHA256 hash SHA256 Wheel py3 Dec 9, 2016
drf_ignore_slash_middleware-0.0.1.tar.gz (1.9 kB) Copy SHA256 hash SHA256 Source None Dec 9, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page