MCPcopy
hub / github.com/pallets/flask / has_app_context

Function has_app_context

src/flask/ctx.py:228–235  ·  view source on GitHub ↗

Works like :func:`has_request_context` but for the application context. You can also just do a boolean check on the :data:`current_app` object instead. .. versionadded:: 0.9

()

Source from the content-addressed store, hash-verified

226
227
228def has_app_context() -> bool:
229 """Works like :func:`has_request_context` but for the application
230 context. You can also just do a boolean check on the
231 :data:`current_app` object instead.
232
233 .. versionadded:: 0.9
234 """
235 return _cv_app.get(None) is not None
236
237
238class AppContext:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected