Skip to content

Instantly share code, notes, and snippets.

@bergantine
Last active October 12, 2015 13:27
Show Gist options
  • Select an option

  • Save bergantine/4033360 to your computer and use it in GitHub Desktop.

Select an option

Save bergantine/4033360 to your computer and use it in GitHub Desktop.
Django Template localhost switch. #django #djangotemplate
{% ifequal request.get_host '127.0.0.1:8000' %}
{# Include something only to be executed on "localhost" here. #}
{% else %}
{# Include something only to be executed in production here. #}
{% endifequal %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment