Pprint jinja2 debug variable helper

I am trying to use the http://jinja.pocoo.org/docs/dev/templates/#pprint pprint function as follows:

{{ 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. Can anyone help me display variables for easy debugging?

+5
source share
1 answer

You should use it as follows:

 {{ flash_messages|pprint }} 

or in your case:

 {{ player|pprint}} 
+5
source

Source: https://habr.com/ru/post/1202087/


All Articles