django提供xml下载
2016-04-18 16:57
489 查看
def test_file_download(request): wb = export_to_xls() response = HttpResponse() response['Content-Type'] = 'application/octet-stream' response['Content-Disposition'] = 'attachment;filename="test.xls"' wb.save(response) return response def export_to_xls(): style0 = xlwt.easyxf('font: name Times New Roman, color-index black, bold on',num_format_str='#,##0.00') style1 = xlwt.easyxf(num_format_str='D-MMM-YY') wb = xlwt.Workbook() ws = wb.add_sheet('A Test Sheet') ws.write(0, 0, 1234.56, style0) ws.write(1, 0, datetime.now(), style1) ws.write(2, 0, 1) ws.write(2, 1, 1) ws.write(2, 2, xlwt.Formula("A3+B3")) return wb
相关文章推荐
- Google Codejam 2016 Round1A Problem C BFFs 简单图论
- Django笔记 Model的继承和操作
- GOF设计模式快速学习
- Django笔记 CMS框架Mezzanine 2
- Google官方MVP示例之TODO-MVP
- 一起学Django之Day01
- google的Guava库的callback使用分析
- phyton3.5 django典型错误
- AlexNet, VGGNet, GoogLeNet 对比
- django ORM model filter 条件过滤,及多表连接查询、反向查询字段
- google chrome当图片不显示时,默认显示边框的解决办法
- Ajax请求在IE和Google Chrome中可以响应,在Firefox中无法响应
- POJ 3767 I Wanna Go Home(Dijkstra)
- error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message digest algorithm
- ERROR 1153 (08S01): Got a packet bigger than 'max_allowed_packet' bytes
- django orm查询方法详解
- [转]Go语言并发之美
- [转]Golang中goroutine的调度器详解
- windows下go调用内存dll
- django--模板的继承