A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| from django import http | |
| from django.utils.http import urlquote | |
| from django import urls | |
| from django.conf import settings | |
| from django.utils.deprecation import MiddlewareMixin | |
| class AppendOrRemoveSlashMiddleware(MiddlewareMixin): | |
| """Like django's built in APPEND_SLASH functionality, but also works in | |
| reverse. Eg. will remove the slash if a slash-appended url won't resolve, |