Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An option to keep undefined variables #41

Open
pietervogelaar opened this issue Jun 11, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@pietervogelaar
Copy link

commented Jun 11, 2019

It would be nice to support multi stage rendering as described at https://stackoverflow.com/a/53134416/948378.

from jinja2 import Environment, BaseLoader,DebugUndefined
rtemplate =Environment(loader=BaseLoader,undefined=DebugUndefined).from_string("{{ a }} is defined, but {{ b}} is undefined")

print(rtemplate.render({"a":"a"}))

# The result is:
# a is defined, but {{ b }} is undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.