This is a sample on how to stream the results of a large QuerySet into a CSV file using Django StreamingHttpResponse class.
- Add the
CSVStreamclass in your project, for example awriters.pyfile:
import csv
from django.http import StreamingHttpResponse