6. Autoescape ExtensionΒΆ

Import name: jinja2.ext.autoescape

New in version 2.4.

The autoescape extension allows you to toggle the autoescape feature from within the template. If the environment’s autoescape setting is set to False it can be activated, if it’s True it can be deactivated. The setting overriding is scoped.