From 52866f9c84d88e7ba787b65d7997103b72c268d6 Mon Sep 17 00:00:00 2001 From: fram3d Date: Tue, 16 Jan 2024 13:28:11 +0100 Subject: [PATCH] fix init_db file and run.py --- init_db.py | 5 +++-- run.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/init_db.py b/init_db.py index f57e56b..ea57a7c 100755 --- a/init_db.py +++ b/init_db.py @@ -1,9 +1,10 @@ #!/usr/bin/env python3 -from flaskapp import db +from taskmanager import db, app print('[i] Trying to create databse...') try: - db.create_all() + with app.app_context(): + db.create_all() print('[+] Success you can proceed with deployment!') except: print('[-] Creating db failed :/') diff --git a/run.py b/run.py index a64dc5f..80db040 100755 --- a/run.py +++ b/run.py @@ -1,4 +1,5 @@ -from flaskapp import app +#!/usr/bin/env python3 +from taskmanager import app if __name__ == '__main__': app.run(debug=False)