Updated for before_first_request decorator deprecation
This commit is contained in:
@@ -61,10 +61,8 @@ def create_app():
|
|||||||
app.register_blueprint(view, url_prefix='/admin/view')
|
app.register_blueprint(view, url_prefix='/admin/view')
|
||||||
app.register_blueprint(analysis, url_prefix='/admin/analysis')
|
app.register_blueprint(analysis, url_prefix='/admin/analysis')
|
||||||
|
|
||||||
"""Create Database Tables before First Request"""
|
"""Create Database Tables when creating app"""
|
||||||
@app.before_first_request
|
with app.app_context():
|
||||||
def _create_database_tables():
|
db.create_all()
|
||||||
with app.app_context():
|
|
||||||
db.create_all()
|
|
||||||
|
|
||||||
return app
|
return app
|
Reference in New Issue
Block a user