jinja2.environment.Template.new_context

Template.new_context(vars=None, shared=False, locals=None)[source]

Create a new Context for this template. The vars provided will be passed to the template. Per default the globals are added to the context. If shared is set to True the data is passed as it to the context without adding the globals.

locals can be a dict of local variables for internal usage.