Задать вопрос

Тел: +7 965 3737 888

450

Просмотров

2

Ответов

Excel Export with xlwt

how to generate a (real) excel file as an HTTP response with xlwt

Вопрос полезен? Да0/Нет0
file_4600.py(440.0б)
None

Ответы (2):

Ответredglyph:07.04.2012
Ответ полезен? Да0/Нет0

The following is also missing:

from django.http import HttpResponse

Finally, the MIME type is wrong, it should be like this:

response = HttpResponse(mimetype="application/vnd.ms-excel")

Ответluckidog:09.06.2011
Ответ полезен? Да0/Нет0

IE seems to require that file.xls be "file.xls" Or it will puke saying it can't save the file if your url ends in a slash.