The Flask-Script extension provides support for writing external scripts
in Flask. This includes running a development server, a customised
Python shell, scripts to set up your database, cronjobs, and other
command-line tasks that belong outside the web application itself.

WWW: http://flask-script.readthedocs.io/en/latest/