render_template
in Flask only seems to work when it's done at the end of a function, eg return render_template('index.html')
. I have a long function where I want to update a webpage several times to keep the user updated with the progress. Should this just be split into several functions with each one rendering a new page?
Asked
Active
Viewed 28 times
0

ZhouW
- 1,187
- 3
- 16
- 39
-
2Please add a [mcve] to your question – PRMoureu Aug 22 '18 at 10:14
-
3There is a misconception in your thought. This responsibility is not from Flask, but from the front (browser). Take a look at Flask + AJAX examples. – Mauro Baraldi Aug 22 '18 at 10:25
-
it's more JS work. – ipeacocks Aug 22 '18 at 11:42