Skip to content
Myr

update docs on adding extensions (#1237)

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

authored by sixtyfathoms · committed by GitHub · parent 30c23f5 · Browse files · 1 file+5 added−2 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+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:docs/extensions.rst+5 added-2 removed
9 unmodified lines
1011Adding Extensions12-----------------1314Extensions are added to the Jinja environment at creation time. Once the15environment is created additional extensions cannot be added. To add an14Extensions are added to the Jinja environment at creation time. To add an15extension pass a list of extension classes or import paths to the16``extensions`` parameter of the :class:`~jinja2.Environment` constructor. The following17example creates a Jinja environment with the i18n extension loaded::1819 jinja_env = Environment(extensions=['jinja2.ext.i18n'])2021To add extensions after creation time, use the :meth:`~jinja2.Environment.add_extension` method::2223 jinja_env.add_extension('jinja2.ext.debug')242526.. _i18n-extension:2728i18n Extension29--------------
376 unmodified lines