diff --git a/server.py b/server.py index 139d90d..3746e9e 100644 --- a/server.py +++ b/server.py @@ -4,16 +4,18 @@ import mariadb mydb = mariadb.connect( host="", user="", - password="" + password="", + database="" ) -print(mydb) +cursor = mydb.cursor() app = Flask(__name__) @app.get("/") def show(): - return render_template('show.html') + cursor.execute('SELECT * FROM items') + return render_template('show.html', cursor=cursor) @app.post("/") def create(): diff --git a/templates/show.html b/templates/show.html index ebd4102..cd7a0be 100644 --- a/templates/show.html +++ b/templates/show.html @@ -7,8 +7,11 @@