Skip to content

Set app.jinja_env.undefined to something better when debug = True #1006

@untitaker

Description

@untitaker

Currently missing attributes of template variables are swallowed by Flask, even
in debug mode:

@app.route('/')
def index():
    # template contains:
    # {{ lol.asdf }}
    return flask.render_template('lol.htm', lol=3)

I propose we set app.jinja_env.undefined to some type that logs warnings to
console when Flask's debug mode is enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions