全局对象current_app解析
from werkzeug.local import LocalProxy
from werkzeug.local import LocalStack
def _find_app():
top = _app_ctx_stack.top
if top is None:
raise RuntimeError(_app_ctx_err_msg)
return top.app
_app_ctx_stack = LocalStack()
current_app = LocalProxy(_find_app)Last updated