Changes and docs are modified.
This commit is contained in:
parent
5e12748d0e
commit
a9066a3756
2 changed files with 18 additions and 0 deletions
17
docs/api.rst
17
docs/api.rst
|
|
@ -538,6 +538,23 @@ The following signals exist in Flask:
|
|||
from flask import template_rendered
|
||||
template_rendered.connect(log_template_renders, app)
|
||||
|
||||
.. data:: flask.before_render_template
|
||||
:noindex:
|
||||
|
||||
This signal is sent before template rendering process. The
|
||||
signal is invoked with the instance of the template as `template`
|
||||
and the context as dictionary (named `context`).
|
||||
|
||||
Example subscriber::
|
||||
|
||||
def log_template_renders(sender, template, context, **extra):
|
||||
sender.logger.debug('Rendering template "%s" with context %s',
|
||||
template.name or 'string template',
|
||||
context)
|
||||
|
||||
from flask import before_render_template
|
||||
before_render_template.connect(log_template_renders, app)
|
||||
|
||||
.. data:: request_started
|
||||
|
||||
This signal is sent when the request context is set up, before
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue