How to see exception generated into django template variable?

前端 未结 6 2041
庸人自扰
庸人自扰 2020-12-29 07:22

Inside a Django template, one can call an object method like this :

{{ my_object.my_method }}

The problem is when you get an exception/bug

6条回答
  •  时光说笑
    2020-12-29 07:59

    Similar to S. Lott's answer, activate the management shell (python manage.py shell) and create the appropriate instance of my_object, call my_method. Or put exception handling in my_method and log the exception.

提交回复
热议问题