Что-то вроде:
response = HttpResponse(content_type='text/csv') # Format response as a CSV
filename = 'some_file_name.csv'
response['Content-Disposition'] = 'attachment; filename="' + filename + '"'# Name the CSV response
my_df.to_csv(response, encoding='utf-8', index=False)
return response