This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |