This commit is contained in:
David Lord 2022-08-15 07:29:34 -07:00
parent b0b27785ae
commit 1d07857b1d
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8

View file

@ -20,7 +20,7 @@ data and to then invoke that function and pass it to a response object::
def generate(): def generate():
for row in iter_all_rows(): for row in iter_all_rows():
yield f"{','.join(row)}\n" yield f"{','.join(row)}\n"
return generate(), {"Content-Type": "text/csv") return generate(), {"Content-Type": "text/csv"}
Each ``yield`` expression is directly sent to the browser. Note though Each ``yield`` expression is directly sent to the browser. Note though
that some WSGI middlewares might break streaming, so be careful there in that some WSGI middlewares might break streaming, so be careful there in