Class ImportTag

  • All Implemented Interfaces:
    Importable, Tag, Serializable

    public class ImportTag
    extends Object
    implements Tag
    Jinja2 supports putting often used code into macros. These macros can go into different templates and get imported from there. This works similar to the import statements in Python. It’s important to know that imports are cached and imported templates don’t have access to the current template variables, just the globals by default.
    Author:
    jstehler
    See Also:
    Serialized Form