cw = csv.writer(si)
cw.writerows(csvList)
output = make_response(si.getvalue())
output.headers['Content-Disposition'] = 'attachment; filename=export.csv'
output.headers['Content-type'] = 'text/csv'
return output
Написание CSV из фреймворка Flask