I want to disable a block in development and use it in deployment in google apps in python development. What changes do i need to make in template or main script?
+3
A:
If you've got the middleware django.core.content_processors.debug then you can just do this in your template:
{% block mydebugonly %}
{% if debug %}
<p>Something that will only appear if the DEBUG setting is True.</p>
{% endif %}
{% endblock %}
Dominic Rodger
2009-06-12 06:33:01
The debug middleware also requires that you put the IP address of the testing machines in the ``INTERNAL_IPS`` setting, usually INTERNAL_IPS = ('127.0.0.1',) will do the trick. I seem to always forget to do this when putting debug blocks in my code.
Prairiedogg
2009-06-13 01:52:28