浏览代码

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

Windson yang 7 年之前
父节点
当前提交
4fe5d84666
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      docs/ref/request-response.txt

+ 2 - 0
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.