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

Debug mode for handling undefined variables #5952

Open
roed314 opened this issue Mar 15, 2024 · 0 comments
Open

Debug mode for handling undefined variables #5952

roed314 opened this issue Mar 15, 2024 · 0 comments
Labels
feature request Feature request

Comments

@roed314
Copy link
Contributor

roed314 commented Mar 15, 2024

Currently, if you're working on a template and you make an error in jinja where there is an undefined variable, it just won't display anything. This makes it difficult to find the problem. Jinja has a configuration option to make it raise an error. Roughly, we can enable this by adding the following to app.py:

if is_debug_mode():
    from jinja2 import StrictUndefined
    app.jinja_options["undefined"] = StrictUndefined

But this doesn't quite work for several reasons. It would be great to make it work.

@AndrewVSutherland AndrewVSutherland added the feature request Feature request label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants