Use absolute db path

This commit is contained in:
Tahar Lamred & Theresa Nerz 2026-07-01 17:07:04 +02:00
parent 23d3318be1
commit c14ecdff80

View file

@ -3,9 +3,11 @@ import sqlite3
from flask import Flask, request
app = Flask(__name__)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DB_PATH = os.path.join(BASE_DIR, "adventure.db")
def get_db():
db = sqlite3.connect("adventure.db")
db = sqlite3.connect(DB_PATH)
db.row_factory = sqlite3.Row
return db