reconfigure the app from run command and method
extract templates_auto_reload to property continues #1910 closes #1907
This commit is contained in:
parent
9e39c506e0
commit
4fc48200a5
3 changed files with 60 additions and 10 deletions
|
|
@ -319,8 +319,10 @@ class ScriptInfo(object):
|
|||
be returned.
|
||||
"""
|
||||
__traceback_hide__ = True
|
||||
|
||||
if self._loaded_app is not None:
|
||||
return self._loaded_app
|
||||
|
||||
if self.create_app is not None:
|
||||
rv = call_factory(self.create_app, self)
|
||||
else:
|
||||
|
|
@ -330,10 +332,14 @@ class ScriptInfo(object):
|
|||
'the FLASK_APP environment variable.\n\nFor more '
|
||||
'information see '
|
||||
'http://flask.pocoo.org/docs/latest/quickstart/')
|
||||
|
||||
rv = locate_app(self, self.app_import_path)
|
||||
|
||||
debug = get_debug_flag()
|
||||
|
||||
if debug is not None:
|
||||
rv.debug = debug
|
||||
rv._reconfigure_for_run_debug(debug)
|
||||
|
||||
self._loaded_app = rv
|
||||
return rv
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue