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

--strict should make {{ environ('does_not_exist') }} fail? #95

Open
gijsdpg opened this issue Aug 18, 2021 · 1 comment
Open

--strict should make {{ environ('does_not_exist') }} fail? #95

gijsdpg opened this issue Aug 18, 2021 · 1 comment

Comments

@gijsdpg
Copy link

gijsdpg commented Aug 18, 2021

Currently, there is no way to force jinja2-cli to stop processing a template when an environment variable is missing. The template is rendered with None as the missing value. It would be awesome if jinja2-cli would fail on the missing variable.

@TheErk
Copy link

TheErk commented Mar 28, 2022

You can write:

{{environ('MYVAR') or MYVAR}}

in your template file and the processing will fail if MYVAR is neither defined in the env or from the other way you can pass key/value to jinja2-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants