A bunch of random crap working towards the first (simplest) upload mechanism

This commit is contained in:
2025-11-01 21:03:51 -04:00
parent d59e23fc4c
commit d406574707
4 changed files with 82 additions and 15 deletions

View File

@@ -1,15 +0,0 @@
from flask import g
from sqlite import SQLite
import json
def get_db():
db = getattr(g, "_database", None)
if db is None:
with open('../../config.json') as config_file:
config_json = json.load(config_file.read())
if str(config_json["database"]["type"]).casefold() == "SQLite".casefold():
db = g._database = SQLite(config_json["database"]["name"])
return db