Skip to content
Myr

lazy load app on reload only

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

authored by David Lord · committed by David Lord · parent a83d6d2 · Browse files · 2 files+8 added−4 removed
This commit

State

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

Diff stats

2 files+8 added−4 removed

  • other:+8 added−4 removed

2 files+8 added−4 removed

modified:src/flask/cli.py+5 added-4 removed
294 unmodified lines
295 it is recorded and shown as part of the WSGI handling which in case296 of the Werkzeug debugger means that it shows up in the browser.297 """298299 def __init__(self, loader, use_eager_loading=False):299 def __init__(self, loader, use_eager_loading=None):300 self.loader = loader301 self._app = None302 self._lock = Lock()303 self._bg_loading_exc_info = None304305 if use_eager_loading is None:306 use_eager_loading = os.environ.get("WERKZEUG_RUN_MAIN") != "true"307308 if use_eager_loading:309 self._load_unlocked()310 else:311 self._load_in_background()
532 unmodified lines
844845 if debugger is None:846 debugger = debug847844 if eager_loading is None:845 eager_loading = not reload846848 show_server_banner(get_env(), debug, info.app_import_path, eager_loading)849 app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)850851 from werkzeug.serving import run_simple
121 unmodified lines
modified:CHANGES.rst+3 added
8 unmodified lines
9 setting the session cookie name dynamically. :pr:`3369`10- Add :meth:`Config.from_file` to load config using arbitrary file11 loaders, such as ``toml.load`` or ``json.load``.12 :meth:`Config.from_json` is deprecated in favor of this. :pr:`3398`13- The ``flask run`` command will only defer errors on reload. Errors14 present during the initial call will cause the server to exit with15 the traceback immediately. :issue:`3431`161718Version 1.1.219-------------
1004 unmodified lines