We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c78bed commit 0d195b7Copy full SHA for 0d195b7
flask_session/sessions.py
@@ -647,8 +647,9 @@ def __repr__(self):
647
648
from sqlalchemy import inspect
649
650
- if not inspect(db.engine).has_table("Session"):
651
- self.db.create_all()
+ with app.app_context():
+ if not inspect(db.engine).has_table("Session"):
652
+ self.db.create_all()
653
654
self.sql_session_model = Session
655
0 commit comments