Skip to content

Commit 80de2df

Browse files
committed
App context is now required in Flask-SQLAlchemy
1 parent 3a35f0e commit 80de2df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ def load_user(id):
3636

3737
def create_database(app):
3838
if not path.exists('website/' + DB_NAME):
39-
db.create_all(app=app)
39+
with app.app_context():
40+
db.create_all()
4041
print('Created Database!')

0 commit comments

Comments
 (0)