Skip to content
Myr

improved _request_ctx_stack docs

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 bcd746e · Browse files · 1 file+30 added−0 removed
This commit

State

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

Diff stats

1 file+30 added−0 removed

  • other:+30 added−0 removed

1 file+30 added−0 removed

modified:docs/api.rst+30 added
299 unmodified lines
300 all the context local objects used in Flask. This is a documented301 instance and can be used by extensions and application code but the302 use is discouraged in general.303304 The following attributes are always present on each layer of the305 stack::306307 `app`308 the active Flask application.309310 `url_adapter`311 the URL adapter that was used to match the request.312313 `request`314 the current request object.315316 `session`317 the active session object.318319 `g`320 an object with all the attributes of the :data:`flask.g` object.321322 `flashes`323 an internal cache for the flashed messages.324325 Example usage::326327 from flask import _request_ctx_stack328329 def get_session():330 ctx = _request_ctx_stack.top331 if ctx is not None:332 return ctx.session333334 .. versionchanged:: 0.4335336 The request context is automatically popped at the end of the request337 for you. In debug mode the request context is kept around if
12 unmodified lines