summaryrefslogtreecommitdiff
path: root/app/database.py
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-03-23 12:30:23 -0500
committerstilbruch <stilbruch@protonmail.com>2022-03-23 12:30:23 -0500
commitc57ebef076438c83a0e408227341398249566ff1 (patch)
treed4e943e771a127d285baaee14867f48040f23c8d /app/database.py
parent43755d0b6d1f65fd65862454be81bd0f5d7ff7dd (diff)
downloadStrengthy-c57ebef076438c83a0e408227341398249566ff1.tar.xz
Strengthy-c57ebef076438c83a0e408227341398249566ff1.zip
User registration and login now works
Diffstat (limited to 'app/database.py')
-rw-r--r--app/database.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/app/database.py b/app/database.py
deleted file mode 100644
index e23aa5d..0000000
--- a/app/database.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import sqlite3
-from app import app
-from flask import g
-
-# constants
-DATABASE_FILE = "../strengthy.db"
-
-# Called when an "appcontext" is closed, usually a request is finished
-@app.teardown_appcontext
-def close_db_conn(exception):
- db = getattr(g, '_database', None)
- if db is not None:
- db.close()
-
-def database_get():
- db = getattr(g, '_database', None)
- if db is None:
- db = g._database = sqlite3.connect(DATABASE_FILE)
- return db