mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #29278 -- Doc'd that a context manager can't be used with FileResponse.
This commit is contained in:
parent
e6c21217d3
commit
4fe5d84666
@ -1057,3 +1057,5 @@ otherwise it streams the file out in small chunks.
|
|||||||
|
|
||||||
>>> from django.http import FileResponse
|
>>> from django.http import FileResponse
|
||||||
>>> response = FileResponse(open('myfile.png', 'rb'))
|
>>> response = FileResponse(open('myfile.png', 'rb'))
|
||||||
|
|
||||||
|
The file will be closed automatically, so don't open it with a context manager.
|
||||||
|
Loading…
Reference in New Issue
Block a user