Skip to content
Myr

Updated docs for the app context.

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

authored by Armin Ronacher · committed by Armin Ronacher · parent f8f2e2d · Browse files · 3 files+28 added−1 removed
This commit

State

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

Diff stats

3 files+28 added−1 removed

  • other:+28 added−1 removed

3 files+28 added−1 removed

modified:docs/api.rst+15 added-1 removed
263 unmodified lines
264.. data:: current_app265266 Points to the application handling the request. This is useful for267 extensions that want to support multiple applications running side268 by side.268 by side. This is powered by the application context and not by the269 request context, so you can change the value of this proxy by270 using the :meth:`~flask.Flask.app_context` method.271272 This is a proxy. See :ref:`notes-on-proxies` for more information.273274.. autofunction:: has_request_context275276.. autofunction:: has_app_context277278.. autofunction:: url_for279280.. function:: abort(code)281
133 unmodified lines
415 ctx = _request_ctx_stack.top416 if ctx is not None:417 return ctx.session418419.. autoclass:: flask.ctx.AppContext420 :members:421422.. data:: _app_ctx_stack423424 Works similar to the request context but only binds the application.425 This is mainly there for extensions to store data.426427 .. versionadded:: 0.9428429.. autoclass:: flask.blueprints.BlueprintSetupState430 :members:431432Signals
210 unmodified lines
modified:flask/ctx.py+10 added
57 unmodified lines
58 """59 return _request_ctx_stack.top is not None606162def has_app_context():63 """Worksl ike :func:`has_request_context` but for the application64 context. You can also just do a boolean check on the65 :data:`current_app` object instead.6667 .. versionadded:: 0.968 """69 return _app_ctx_stack.top is not None707172class AppContext(object):73 """The application context binds an application object implicitly74 to the current thread or greenlet, similar to how the75 :class:`RequestContext` binds request information. The application
167 unmodified lines
modified:CHANGES+3 added
43 unmodified lines
44 file is provided.45- The :meth:`flask.render_template` method now accepts a either an iterable of46 template names or a single template name. Previously, it only accepted a47 single template name. On an iterable, the first template found is rendered.48- Added :meth:`flask.Flask.app_context` which works very similar to the49 request context but only provides access to the current application. This50 also adds support for URL generation without an active request context.515253Version 0.8.154-------------
295 unmodified lines