summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWindson yang <wiwindson@outlook.com>2018-04-02 23:39:29 +0800
committerTim Graham <timograham@gmail.com>2018-04-04 10:19:12 -0400
commita390cc710939365e58e6dc98ec282e532f71a3f9 (patch)
tree92bf9b1dc9186b7c444c161fe8f931e122482e35
parente2b7ad435789eea6996aaeeff74637ee5243c61f (diff)
[2.0.x] Fixed #29278 -- Doc'd that a context manager can't be used with FileResponse.
Backport of 4fe5d846666d46a5395a5f0ea2845a96b6837a75 from master
-rw-r--r--docs/ref/request-response.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 77298b5bbf..aca839469b 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -1050,3 +1050,5 @@ otherwise it streams the file out in small chunks.
>>> from django.http import FileResponse
>>> response = FileResponse(open('myfile.png', 'rb'))
+
+The file will be closed automatically, so don't open it with a context manager.