Skip to content

Commit

Permalink
Fixed SQLAlchemy Instance Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
tahaafarooq authored May 19, 2024
1 parent ec075e0 commit 68d4b8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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'
Expand Down

0 comments on commit 68d4b8c

Please sign in to comment.