I'm trying to use http://jinja.pocoo.org/docs/dev/templates/#pprint pprint
function like this:
{{ pprint(player) }}
in my html file, but I get the following error:
jinja2.exceptions.UndefinedError
UndefinedError: 'pprint' is undefined
Jinja2 is a template engine for python. Anyone could help me to display variables for easy debug?
Variables. Template variables are defined by the context dictionary passed to the template. You can mess around with the variables in templates provided they are passed in by the application. Variables may have attributes or elements on them you can access too.
You have to use it this way:
{{ flash_messages|pprint }}
or in your case:
{{ player|pprint}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With