• Home
  • Raw
  • Download

Lines Matching full:environment

16 Jinja uses a central object called the template :class:`Environment`.
20 :class:`Template` class, an environment is created automatically for you,
23 Most applications will create one :class:`Environment` object on application
33 from jinja2 import Environment, PackageLoader, select_autoescape
34 env = Environment(
39 This will create a template environment with a loader that looks up
50 To load a template from this environment, call the :meth:`get_template`
64 or :meth:`Environment.from_string` has multiple advantages. Besides being
82 .. autoclass:: Environment([options])
90 an environment is created automatically. These environments are
92 may have the same anonymous environment. For all shared environments
97 If the environment is sandboxed this attribute is `True`. For the
103 A dict of filters for this environment. As long as no template was
110 A dict of test functions for this environment. As long as no
159 return environment.undefined(name='some_name')
166 return environment.undefined(obj=obj, name='attr')
171 return environment.undefined('no first item, sequence was empty')
184 this dict as it may be shared with other templates or the environment
208 .. autoclass:: jinja2.environment.TemplateStream()
231 from jinja2 import Environment, select_autoescape
232 env = Environment(autoescape=select_autoescape(['html', 'htm', 'xml']),
271 These classes can be used as undefined types. The :class:`Environment`
362 :attr:`Environment.globals` or :attr:`Template.globals` or points
368 The template local variables. This list contains environment and
374 .. attribute:: environment
376 The environment that loaded the template.
420 file system. The environment will keep the compiled modules in memory like
459 To use a bytecode cache, instantiate it and pass it to the :class:`Environment`.
468 .. attribute:: environment
470 The :class:`Environment` that created the bucket.
500 environment to compile different code behind the scenes in order to
529 Starting with Jinja 2.9 policies can be configured on the environment
532 :attr:`~jinja2.Environment.policies` attribute.
577 functions to a Jinja environment.
665 You can register it on the template environment by updating the
666 :attr:`~Environment.filters` dict on the environment::
668 environment.filters['datetimeformat'] = datetimeformat
677 Filters can also be passed the current template context or environment. This
679 :attr:`~Environment.autoescape` setting. For this purpose three decorators
703 active :class:`Context` rather than the environment.
719 environment callables in order to check for the autoescape status from the
720 environment. In new versions it's encouraged to check the setting from the
774 to the environment or context and that they can't be chained. The return
792 You can register it on the template environment by updating the
793 :attr:`~Environment.tests` dict on the environment::
795 environment.tests['prime'] = is_prime
813 Variables stored in the :attr:`Environment.globals` dict are special as they
831 .. automethod:: Environment.lex
833 .. automethod:: Environment.parse
835 .. automethod:: Environment.preprocess
867 in later versions that may be returned by :meth:`~Environment.parse`.
877 returned by the :meth:`Environment.parse` method.