flask.cli with_appcontext Example Code

with_appcontext is a Flask decorator in the flask.cli module that wraps a callback to guarantee it will be called with a script's application context. Any callbacks registered with app.cli are wrapped with this function by default.

AppGroup, DispatchingApp, FlaskGroup, ScriptInfo, and pass_script_info are several other callables with code examples from the same flask.cli package.

Example 1 from FlaskBB

FlaskBB (project website) is a Flask-based forum web application. The web app allows users to chat in an open message board or send private messages in plain text or Markdown.

FlaskBB is provided as open source under this license.

FlaskBB / flaskbb / cli / main.py