Django Book 翻译
菜单>:
TOC
返回
原文:
This is the general pattern youll use any time you need to return non-HTML content: create an ``HttpResponse`` response object (with a special MIME type), pass it to something expecting a file, and then return the response.
翻译:
在任何需要返回非 HTML 内容的时候,都需要经过以下几步:创建一个 ``HttpResponse`` 响应对象(需要指定特殊的 MIME 类型)。将它作为参数传给一个需要文件的方法,然后返回这个响应。
备注:
译者: