how to check DEBUG true/false in django template - exactly in layout.html [duplicate]
问题 This question already has answers here : How to check the TEMPLATE_DEBUG flag in a django template? (6 answers) Closed 4 years ago . I would like distinguish a look of some toolbar in layout.html depending if DEBUG = True or not. I am aware of this answer using django.core.context_processors.debug but it forces me to use RequestContext instead of Request what I not really like, btw how can I use RequestContext for layout.html which extends base.html ? And generally is there some better way to