How to check the TEMPLATE_DEBUG flag in a django template?

前端 未结 6 737
既然无缘
既然无缘 2020-12-04 15:31

Do you know if it is possible to know in a django template if the TEMPLATE_DEBUG flag is set?

I would like to disable my google analytics script when I am running my

6条回答
  •  一个人的身影
    2020-12-04 15:55

    You will need to add the DEBUG flag to your context_processors.

    There may not even be an alternative way. At least, none that I know of.

提交回复
热议问题