[2.0.x] Fixed #29278 -- Doc'd that a context manager can't be used with FileResponse.

Backport of 4fe5d84666 from master
This commit is contained in:
Windson yang 2018-04-02 23:39:29 +08:00 committed by Tim Graham
parent e2b7ad4357
commit a390cc7109
1 changed files with 2 additions and 0 deletions

View File

@ -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.