Skip to content
Myr

Add explicit `(lazy loading)` message to `flask run` related to #2706

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Bruno Rocha · committed by Bruno Rocha · parent 3a0ea72 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:flask/cli.py+6 added-3 removed
612 unmodified lines
613614 return new_dir is not None # at least one file was located and loaded615616617def show_server_banner(env, debug, app_import_path):617def show_server_banner(env, debug, app_import_path, eager_loading=True):618 """Show extra startup messages the first time the server is run,619 ignoring the reloader.620 """621 if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':622 return623624 if app_import_path is not None:625 print(' * Serving Flask app "{0}"'.format(app_import_path))625 message = ' * Serving Flask app "{0}"'.format(app_import_path)626 if not eager_loading:627 message += ' (lazy loading)'628 print(message)629630 print(' * Environment: {0}'.format(env))631632 if env == 'production':
128 unmodified lines
761762 if eager_loading is None:763 eager_loading = not reload764762 show_server_banner(get_env(), debug, info.app_import_path)765 show_server_banner(get_env(), debug, info.app_import_path, eager_loading)766 app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)767768 from werkzeug.serving import run_simple769 run_simple(host, port, app, use_reloader=reload, use_debugger=debugger,
124 unmodified lines