diff options
| author | stilbruch <stilbruch@protonmail.com> | 2022-03-23 12:30:23 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonmail.com> | 2022-03-23 12:30:23 -0500 |
| commit | c57ebef076438c83a0e408227341398249566ff1 (patch) | |
| tree | d4e943e771a127d285baaee14867f48040f23c8d /app/database.py | |
| parent | 43755d0b6d1f65fd65862454be81bd0f5d7ff7dd (diff) | |
| download | Strengthy-c57ebef076438c83a0e408227341398249566ff1.tar.xz Strengthy-c57ebef076438c83a0e408227341398249566ff1.zip | |
User registration and login now works
Diffstat (limited to 'app/database.py')
| -rw-r--r-- | app/database.py | 19 |
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 |
