Closed patriacaelum closed 5 days ago
The blog tutorial has a section that imports pathlib.Path but doesn't use it, causing the lines where the path to the db and schema files fail.
pathlib.Path
from pathlib import Path from sqlite3 import dbapi2 as sqlite3 app.config.update({ "DATABASE": app.root_path / "blog.db", }) def _connect_db(): engine = sqlite3.connect(app.config["DATABASE"]) engine.row_factory = sqlite3.Row return engine def init_db(): db = _connect_db() with open(app.root_path / "schema.sql", mode="r") as file_: db.cursor().executescript(file_.read()) db.commit()
Environment:
The blog tutorial has a section that imports
pathlib.Path
but doesn't use it, causing the lines where the path to the db and schema files fail.Environment: