views:

61

answers:

1

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
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