Browse Source

Chapter 5: Shell context (5c)

master
T. Meissner 6 years ago
parent
commit
da527b20be
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      hello.py

+ 5
- 0
hello.py View File

@ -46,6 +46,11 @@ class NameForm(FlaskForm):
submit = SubmitField('Submit') submit = SubmitField('Submit')
@app.shell_context_processor
def make_shell_context():
return dict(db=db, User=User, Role=Role)
@app.errorhandler(404) @app.errorhandler(404)
def page_not_found(e): def page_not_found(e):
return render_template('404.html'), 404 return render_template('404.html'), 404


Loading…
Cancel
Save