(一)前端页面展示
(二)路由展示
(三)试图函数展示
文件路径
代码:
from django.http import HttpResponse, FileResponse
def download_template(request):
file = open('static/files/BatchPayTemplate.xls', 'rb')
response = FileResponse(file)
response['Content-Type'] = 'application/octet-stream'
response['Content-Disposition'] = 'attachment;filename="BatchPayTemplate.xls"'
return response