Python flask.cli.run_command() Examples

The following are 2 code examples of flask.cli.run_command(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask.cli , or try the search function .
Example #1
Source File: cli.py    From flask-unchained with MIT License 6 votes vote down vote up
def _get_main_cli():
    # deferred imports to not cause circular dependencies
    from flask_unchained.commands import (
        clean, lint, new, qtconsole, shell, unchained, url, urls)

    cli.add_command(clean)
    cli.add_command(lint)
    cli.add_command(new)
    if qtconsole:  # skipcq: PYL-W0125
        cli.add_command(qtconsole)
    cli.add_command(flask_cli.run_command)
    cli.add_command(shell)
    cli.add_command(unchained)
    cli.add_command(url)
    cli.add_command(urls)
    return cli 
Example #2
Source File: manage.py    From flask-react-spa with MIT License 5 votes vote down vote up
def main():
    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('--env', default='dev')
    args, _ = parser.parse_known_args()

    if args.env == 'dev':
        os.environ['FLASK_DEBUG'] = 'true'

    cli.add_command(run_command)
    cli.main(args=sys.argv[1:])