return rv

@app.route('/')
def index():

    def g():
        for i, c in enumerate('hello' * 10):
            time.sleep(0.1)
yield i, c
return Response(stream_template('index.html', data=g()))
if __name__ == '__main__':
    app.run(host='localhost', port=23423)
Streaming data with Python and Flask