test.py
This file
Path
examples/basic/test.py
29 lines · 679 bytes · Python
Last changed by
fix Jinja syntax in example (#2056)David Lordbefore adoption13ce60b
History of this fileTake it
The walk stopped after 200 commits: lines older than beabf30 point at it.
Merge pull request #1383 from pallets/test-decoratorsDavid Lordbefore adoptionbeabf30
lines 1–7why, one step back1from jinja2 import Environment2from jinja2.loaders import DictLoader34env = Environment(5 loader=DictLoader(6 {7 "child.html": """\Merge remote-tracking branch 'origin/3.0.x'David Lordbefore adoptionf1c51b3
line 8why, one step back8{% extends default_layout or 'default.html' %}fix Jinja syntax in example (#2056)David Lordbefore adoption13ce60b
line 9why, one step back9{% import 'helpers.html' as helpers %}Merge pull request #1383 from pallets/test-decoratorsDavid Lordbefore adoptionbeabf30
line 10why, one step back10{% macro get_the_answer() %}42{% endmacro %}fix Jinja syntax in example (#2056)David Lordbefore adoption13ce60b
line 11why, one step back11{% set title = 'Hello World' %}Merge pull request #1383 from pallets/test-decoratorsDavid Lordbefore adoptionbeabf30
lines 12–16why, one step back12{% block body %}13 {{ get_the_answer() }}14 {{ helpers.conspirate() }}15{% endblock %}16""",Merge remote-tracking branch 'origin/3.0.x'David Lordbefore adoptionf1c51b3
line 17why, one step back17 "default.html": """\Merge pull request #1383 from pallets/test-decoratorsDavid Lordbefore adoptionbeabf30
lines 18–29why, one step back18<!doctype html>19<title>{{ title }}</title>20{% block body %}{% endblock %}21""",22 "helpers.html": """\23{% macro conspirate() %}23{% endmacro %}24""",25 }26 )27)28tmpl = env.get_template("child.html")29print(tmpl.render())