I have a Flask form to query a database to retrieves entries by country and stores the results as a results
object. Then, these entries are displayed using a jinja2 template I named list.html
by passing results
using render_template
.
Now, I want to dynamically create a text file (or tabbed-delimited file for example) containing these retrieved entries so that it can be downloaded.
First, how do you dynamically create such a text file in Flask? Then, how do you create a link to download this dynamically-created file and include it in the jinja2 template?