mercredi 8 avril 2015

Data from SQLITE to an HTML table in a Flask page

I'm sure this must have been asked and answered many times before, but I can't find an example, or at least not one I understand. That might be because a very new to Flask and quite new Python though?!


I have a table in SQLITE3, and I need to take nearly all the columns in the table and output to a web page. For other pages I've used flask, but that has always been a case of passing 3 or 4 single value variables into the template.


I'm guessing it's something like passing either the cursor, or more likely the rows from the cursor.fetchall() into the template then a for row in rows loop in the template?


Thanks for any help/examples.


Tom


Aucun commentaire:

Enregistrer un commentaire