From 34282e6f30aa65f85554eefe5191327daa922059 Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 24 Jan 2024 17:42:45 +0530 Subject: [PATCH] fix: with app.app_context() --- database/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database/main.py b/database/main.py index 8e9d19f..9537bff 100644 --- a/database/main.py +++ b/database/main.py @@ -17,8 +17,9 @@ class Token(db.Model): def __repr__(self): return f'' -# Initialize the database -db.create_all() +# Create an application context +with app.app_context(): + db.create_all() # API to create a new token entry @app.route('/token', methods=['POST'])