# робота з csv скачиваеться файл somefilename.csv на компютер пользователя
def somev(request):
# Create the HttpResponse object with the appropriate CSV header.
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="somefilename.csv"'
writer = csv.writer(response)
writer.writerow(['First row', 'Foo', 'Bar', 'Baz']) # запись в первую строчку файла
writer.writerow(['Second row', 'A', 'B', 'C', '"Testing"', "Here's a quote"])
return response