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
If modifying INTERNAL_IPS is not possible/suitable, you can do this with a context processor:
in myapp/context_processors.py:
from django.conf import settings
def debug(context):
return {'DEBUG': settings.DEBUG}
in settings.py:
TEMPLATE_CONTEXT_PROCESSORS = (
...
'myapp.context_processors.debug',
)
Then in my templates, simply:
{% if DEBUG %} .header { background:#f00; } {% endif %}