[Python] Jinja2 template include another template from parent directory

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have a jinja2 template at one location and want to include another common template from parent directory. What would be the best approach?

    templates
    |
    - common.jinja2
    |
    - school
    |
    - address.jinja2



    So, in address.jinja2 I would like to include common.jinja2

    Any pointers on how this can be achieved from the template file itself? Should I use the relative approach?

    Continue reading...

Compartilhe esta Página