with tempfile.SpooledTemporaryFile() as tmp:
    with zipfile.ZipFile(tmp, 'w', zipfile.ZIP_DEFLATED) as archive:
        archive.writestr('something.txt', 'Some Content Here')
tmp.seek(0)
return HttpResponse(tmp.read(), mimetype='application/x-zip-compressed')
Create a temporary compressed file