jeudi 19 juillet 2018

Passing a lot of data using Flask to HTML page, without having to manual add fields

I am trying to create a webpage that would display data in tables, pulled from a database. I am using Flask as my back-end server to pass the data onto the page. So if I wanted to pull a data, I would query it and then set it as a variable. Then variable in this case is "headline".

headline = "query from the database

return render_template('tables-basic.html', headline=headline)'

So then in my html code, I would just need to write and the information will be passed in the correct field.

However, this is only for 1 field. I have over 150 different fields to fill, and doing this manually will take a very long time. Is there a quicker way to approach this?




Aucun commentaire:

Enregistrer un commentaire