Use absolute db path
This commit is contained in:
parent
23d3318be1
commit
c14ecdff80
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue