Skip to content

Commit c7ea806

Browse files
committed
add app context
1 parent 80529a3 commit c7ea806

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

labconnect/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ def initialize_extensions(app) -> None:
5555
# Since the application instance is now created, pass it to each Flask
5656
# extension instance to bind it to the Flask application instance (app)
5757
db.init_app(app)
58-
db.create_all()
5958
migrate.init_app(app, db)
6059
jwt.init_app(app)
6160
app.json = OrJSONProvider(app)
6261

62+
with app.app_context():
63+
db.create_all()
64+
6365
@app.after_request
6466
def refresh_expiring_jwts(response):
6567
try:

0 commit comments

Comments
 (0)