Так выглядит мой код
Python
from flask import Flask, render_template, url_for, request
import sqlite3
app = Flask(__name__)
connection = sqlite3.connect('test.db', check_same_thread=False)
cursor = connection.cursor()
@app.route("/")
def home():
cursor.execute("SELECT * FROM TestT")
rows = cursor.fetchmany(100)
return render_template("index.html", rows = rows)
if __name__ == "__main__":
app.run(debug=True)
connection.commit()
connection.close()
html
{% extends 'base.html' %}
{% block title %}
Главная страница
{% endblock%}
{% block body %}
<table>
{% for row in rows %}
<tr>
<td>{{ row.name }}</td>
</tr>
</table>
{% endblock%}