diff options
author | Carlton Gibson <carlton.gibson@noumenal.es> | 2020-10-20 09:14:48 +0200 |
---|---|---|
committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2020-10-22 11:20:39 +0200 |
commit | 0e1eb90316475a46a240297acc623ba767ebe884 (patch) | |
tree | 2c469015668751e2cdcb04ee5440e763980859ac /docs/ref/middleware.txt | |
parent | 284bde3fbe07485d64289e28014a4eada68aef91 (diff) | |
download | django-c/append-slash-opt-out.tar.gz |
Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior.c/append-slash-opt-out
Diffstat (limited to 'docs/ref/middleware.txt')
-rw-r--r-- | docs/ref/middleware.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt index c52bcc5d18..0078c716c0 100644 --- a/docs/ref/middleware.txt +++ b/docs/ref/middleware.txt @@ -61,6 +61,22 @@ Adds a few conveniences for perfectionists: indexer would treat them as separate URLs -- so it's best practice to normalize URLs. + If necessary, individual views may be excluded from the ``APPEND_SLASH`` + behavior using the :func:`~django.views.decorators.common.no_append_slash` + decorator:: + + from django.views.decorators.common import no_append_slash + + @no_append_slash + def sensitive_fbv(request, *args, **kwargs): + """View to be excluded from APPEND_SLASH.""" + return HttpResponse() + + .. versionchanged:: 3.2 + + Support for the :func:`~django.views.decorators.common.no_append_slash` + decorator was added. + * Sets the ``Content-Length`` header for non-streaming responses. .. attribute:: CommonMiddleware.response_redirect_class |