From a1942bb56dc67d23b000b887c589e11997568970 Mon Sep 17 00:00:00 2001 From: ghostersk <68815071+ghostersk@users.noreply.github.com> Date: Sun, 11 Feb 2024 09:48:42 +0000 Subject: [PATCH] Update __init__.py fix issue with python 3.10 where new Flask packages could not run the app --- tiny0/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiny0/__init__.py b/tiny0/__init__.py index a9fb54a..e25f8b8 100644 --- a/tiny0/__init__.py +++ b/tiny0/__init__.py @@ -11,6 +11,8 @@ db = SQLAlchemy(app) # Initialize the database from tiny0.models import URL -db.create_all() +# DB needs to run in context, for Python 3.10 at least and newest packages +with app.app_context(): + db.create_all() from tiny0 import routes