如何用django下载docutils页面?

时间:2015-10-15 01:30:28

标签: django django-admin docutils

我想将我使用docutils完成的所有文档下载到某种格式(html,pdf等)有没有办法轻松完成?

1 个答案:

答案 0 :(得分:0)

以下是一个例子:
    response = HttpResponse(content_type="application/ms-excel")
    response['Content-Disposition'] = 'attachment; filename=excel.xls'
它将以excel格式提供名为excel.xls的附件供您下载