From 4fe5d846666d46a5395a5f0ea2845a96b6837a75 Mon Sep 17 00:00:00 2001 From: Windson yang Date: Mon, 2 Apr 2018 23:39:29 +0800 Subject: Fixed #29278 -- Doc'd that a context manager can't be used with FileResponse. --- docs/ref/request-response.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index e2e8e4cec1..c088186001 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -1057,3 +1057,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. -- cgit v1.2.1