I'm creating an online secured diary application. My app "collects" diary pages into the database. Anyway I also want them to be visible on user's index page as a table with rows and columns such as date, title, etc. At the screenshot from app.py, you can see that db.execute can successfully "select" user data from the database, however it can't be shown on the page. I attach screenshots of both app.py and index.html, as well as the index page itself. Your suggestions will be appreciated. Thanks!
PS: Please don't mind the awful table styling at the index page. I'll handle CSS later lol.
Here's my database schema:
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username TEXT NOT NULL,
hash TEXT NOT NULL
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE UNIQUE INDEX username ON users (username);
CREATE TABLE diaries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
title TEXT NOT NULL,
description TEXT NOT NULL,
img_url TEXT,
FOREIGN KEY(user_id) REFERENCES users(id)
);