Django debug display all variables of a page

后端 未结 6 2070
既然无缘
既然无缘 2020-12-12 19:05

Is there a template tag (or any other trick) I can use to display all the variables available in a page?

6条回答
  •  醉话见心
    2020-12-12 19:16

    A slightly more complex solution with better rewards is to load django-debug-toolbar (documentation here)

    There's an option called 'Templates' with another option to 'Toggle context' and you can see all the variables passed to your template, as well as the ability to see the code behind the template.

    Example of django-debug-toolbar template debugging

提交回复
热议问题