summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/middleware.txt16
-rw-r--r--docs/releases/3.2.txt7
-rw-r--r--docs/topics/http/decorators.txt15
3 files changed, 38 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
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 2f0f2f5a6d..18d63786d2 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -185,6 +185,13 @@ CSRF
* ...
+Decorators
+~~~~~~~~~~
+
+* The new :func:`~django.views.decorators.common.no_append_slash` decorator
+ allows individual views to be excluded from :setting:`APPEND_SLASH` URL
+ normalization.
+
Email
~~~~~
diff --git a/docs/topics/http/decorators.txt b/docs/topics/http/decorators.txt
index fe91d0cc98..cabdd4f01a 100644
--- a/docs/topics/http/decorators.txt
+++ b/docs/topics/http/decorators.txt
@@ -121,3 +121,18 @@ client-side caching.
This decorator adds a ``Cache-Control: max-age=0, no-cache, no-store,
must-revalidate, private`` header to a response to indicate that a page
should never be cached.
+
+.. module:: django.views.decorators.common
+
+Common
+======
+
+.. versionadded:: 3.2
+
+The decorators in :mod:`django.views.decorators.common` allow per-view
+customization of :class:`~django.middleware.common.CommonMiddleware` behavior.
+
+.. function:: no_append_slash()
+
+ This decorator allows individual views to be excluded from
+ :setting:`APPEND_SLASH` URL normalization.