forked from orbit-oss/flask
Updated docs for the app context.
This commit is contained in:
parent
f8f2e2dff4
commit
0207e90155
3 changed files with 28 additions and 1 deletions
10
flask/ctx.py
10
flask/ctx.py
|
|
@ -59,6 +59,16 @@ def has_request_context():
|
|||
return _request_ctx_stack.top is not None
|
||||
|
||||
|
||||
def has_app_context():
|
||||
"""Worksl ike :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
|
||||
"""
|
||||
return _app_ctx_stack.top is not None
|
||||
|
||||
|
||||
class AppContext(object):
|
||||
"""The application context binds an application object implicitly
|
||||
to the current thread or greenlet, similar to how the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue