Right now I've got a mod_wsgi script that's structured like this..
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
I was wondering if anyone knows of a way to change this to operate on a yield
basis instead of return
, that way I can send the page as it's being generated and not only once it's complete, so the page loading can go faster for the user.
However, whenever I swap the output for a list and yield it in the application(), it throws an error:
TypeError: sequence of string values expected, value of type list found