Python Displaying Sqlite3 Database Records On A Flask Local Website
I have been trying to display records from a SQLite3 database created in python with the help of flask on a local Flask webpage. I assigned each collumn of the a record to a dictio
Solution 1:
You are trying to use the ID
, etc. attribute on the Recipes
list, not on each individual dictionary contained. Use the recipe
name, it is bound to the current entry for the iteration:
{% for recipe in Recipes %}
<strong>ID:</strong> {{ recipe.ID }} <br>
<strong>Title:</strong> {{ recipe.Title }} <br>
<strong>Picture:</strong> {{ recipe.Picture }} <br>
<strong>Rating:</strong> {{ recipe.Rating }} <br>
{% endfor %}
Post a Comment for "Python Displaying Sqlite3 Database Records On A Flask Local Website"