Skip to content

Commit 6a04875

Browse files
committedJul 11, 2023
solved AttributeError due to before_first_request
1 parent 7924afc commit 6a04875

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎website/app.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ def create_app(config=None):
2727

2828

2929
def setup_app(app):
30-
# Create tables if they do not exist already
31-
@app.before_first_request
32-
def create_tables():
33-
db.create_all()
3430

3531
db.init_app(app)
32+
# Create tables if they do not exist already
33+
with app.app_context():
34+
db.create_all()
3635
config_oauth(app)
3736
app.register_blueprint(bp, url_prefix='')

0 commit comments

Comments
 (0)
Failed to load comments.