From da527b20befa820cda3e7e578079df1c9dcac7b5 Mon Sep 17 00:00:00 2001 From: tmeissner Date: Wed, 17 Oct 2018 21:48:32 +0200 Subject: [PATCH] Chapter 5: Shell context (5c) --- hello.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hello.py b/hello.py index a978657..0143cff 100644 --- a/hello.py +++ b/hello.py @@ -46,6 +46,11 @@ class NameForm(FlaskForm): submit = SubmitField('Submit') +@app.shell_context_processor +def make_shell_context(): + return dict(db=db, User=User, Role=Role) + + @app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404