mirror of
https://github.com/django/django.git
synced 2025-07-22 18:49:25 +00:00
[2.0.x] Fixed #29278 -- Doc'd that a context manager can't be used with FileResponse.
Backport of 4fe5d846666d46a5395a5f0ea2845a96b6837a75 from master
This commit is contained in:
parent
e2b7ad4357
commit
a390cc7109
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user