summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-12-30 15:19:22 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-12-31 12:49:10 +0100
commitfd1279a44df3b9a837453cd79fd0fbcf81bae39d (patch)
tree1323829d8630fb55acabed516c0a7149574b11fc /docs
parentac72782e61a8e08381cb66005295a4c24ed37f33 (diff)
[1.5.x] Fixed #19519 -- Fired request_finished in the WSGI iterable's close().
Backport of acc5396.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/request-response.txt2
-rw-r--r--docs/ref/signals.txt12
-rw-r--r--docs/releases/1.5.txt13
3 files changed, 27 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 2775c974d0..954e2d057e 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -804,6 +804,8 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in
:class:`~django.template.response.SimpleTemplateResponse`, and the
``render`` method must itself return a valid response object.
+.. _httpresponse-streaming:
+
StreamingHttpResponse objects
=============================
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
index c31c90f4e8..f797b0f555 100644
--- a/docs/ref/signals.txt
+++ b/docs/ref/signals.txt
@@ -448,6 +448,18 @@ request_finished
Sent when Django finishes processing an HTTP request.
+.. note::
+
+ When a view returns a :ref:`streaming response <httpresponse-streaming>`,
+ this signal is sent only after the entire response is consumed by the
+ client (strictly speaking, by the WSGI gateway).
+
+.. versionchanged:: 1.5
+
+ Before Django 1.5, this signal was fired before sending the content to the
+ client. In order to accomodate streaming responses, it is now fired after
+ sending the content.
+
Arguments sent with this signal:
``sender``
diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt
index a449f4ab12..c5e8c61922 100644
--- a/docs/releases/1.5.txt
+++ b/docs/releases/1.5.txt
@@ -411,6 +411,19 @@ attribute. Developers wishing to access the raw POST data for these cases,
should use the :attr:`request.body <django.http.HttpRequest.body>` attribute
instead.
+:data:`~django.core.signals.request_finished` signal
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Django used to send the :data:`~django.core.signals.request_finished` signal
+as soon as the view function returned a response. This interacted badly with
+:ref:`streaming responses <httpresponse-streaming>` that delay content
+generation.
+
+This signal is now sent after the content is fully consumed by the WSGI
+gateway. This might be backwards incompatible if you rely on the signal being
+fired before sending the response content to the client. If you do, you should
+consider using a middleware instead.
+
OPTIONS, PUT and DELETE requests in the test client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~