我将我的数据从数据库中导出到一个 excel 文件中:
response = HttpResponse(mimetype="application/ms-excel")
response['Content-Disposition'] = 'attachment; filename=Countries.xls'
wb = xlwt.Workbook()
ws = wb.add_sheet('Countries')
ws.write(0, 0, 'Country ID')
ws.write(0, 1, 'Country Name')
index = 1
for country in countries:
ws.write(index, 1, country.country_id)
ws.write(index, 1, country.country_name)
index += 1
wb.save(response)
return response
它导出我的excel文件。如何在此文件中添加指向单元格内容的超链接?(country_name
例如是在浏览器中打开卡片的链接)