简体   繁体   中英

How to buffer flush output to the browser in webapp2?

We would like to show real time HTML output for a long running process on a web page but webapp2 is holding all of our HTML output to the browser until the class handling methods return.

In Perl, we used to use:

$| = 1;

...to force stdout output to the browser as processes were running.

We have been searching for a Python webapp2 equivalent but have been unable to find an override so our self.response.write('') commands show up in the browser as we print them.

Any solutions?

It seems that app engine does not support streaming response https://cloud.google.com/appengine/docs/python/requests#Python_Responses .

see if app engine Task Queue is suitable for your requirement https://cloud.google.com/appengine/docs/python/taskqueue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM