mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2026-05-05 07:49:22 -05:00
Remove the use of before_first_request
This commit is contained in:
+4
-5
@@ -28,11 +28,6 @@ class ExampleModel(db.Model):
|
||||
value = db.Column(db.String(100), primary_key=True)
|
||||
|
||||
|
||||
@app.before_first_request
|
||||
def setup():
|
||||
db.create_all()
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
app.logger.info("Hello there")
|
||||
@@ -45,3 +40,7 @@ def redirect_example():
|
||||
response = redirect(url_for('index'))
|
||||
response.set_cookie('test_cookie', '1')
|
||||
return response
|
||||
|
||||
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
|
||||
Reference in New Issue
Block a user