Django debug display all variables of a page

后端 未结 6 2071
既然无缘
既然无缘 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:13

    The debug toolbar does all this and much, much more. See the screencast for more. If you literally just want the variables, you could try

    assert False, locals()
    

    in your view

提交回复
热议问题