def download_blob(request, id): contents = BlobModel.objects.get(id=id).blob_field response = HttpResponse(contents) response['Content-Disposition'] = 'attachment; filename=blob.bin' return response