Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将使用 docutils 完成的所有文档下载为某种格式(html、pdf 等)有没有办法轻松做到这一点?
是的
这是一个示例: response = HttpResponse(content_type="application/ms-excel") response['Content-Disposition'] = 'attachment; filename=excel.xls' 它将提供一个名为 excel.xls 的附件,以 excel 格式供您下载
response = HttpResponse(content_type="application/ms-excel")
response['Content-Disposition'] = 'attachment; filename=excel.xls'