From 68d4b8c31c19693cda62286c275d1365b0ad3582 Mon Sep 17 00:00:00 2001 From: Tahaa Farooq <49201347+tahaafarooq@users.noreply.github.com> Date: Sun, 19 May 2024 13:30:38 +0300 Subject: [PATCH] Fixed SQLAlchemy Instance Problem --- starter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/starter.py b/starter.py index d0933bc..3ce232a 100644 --- a/starter.py +++ b/starter.py @@ -2,9 +2,10 @@ from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap from flask_login import LoginManager +from models import db # init SQLAlchemy so we can use it later in our models -db = SQLAlchemy() +# db = SQLAlchemy() if __name__ == "__main__": app = Flask(__name__) @@ -15,6 +16,9 @@ db.init_app(app) + with app.app_context(): + db.create_all() + # Login manager login_manager = LoginManager() login_manager.login_view = 'auth.login'