Is there a function in Django / Python similar to PHP flush () that allows me to send part of an HTTP response to clients?

According to the prompt from Yahoo :

When users request a page, it can take 200 to 500 ms for the server server to stitch together an HTML page. During this time, the browser does not work, since it is waiting for data. In PHP, you have the flush () function. This allows you to send a partially finished HTML response to the browser so that the browser can run the components while your server is running from the rest of the HTML page.

Example:

   ... <!-- css, js -->
    </head>
    <?php flush(); ?>
    <body>
      ... <!-- content -->

Is there a function in Django / Python that is similar to PHP flush()?

thank

+5

All Articles