If GET
{% if request.method == "GET" %} Get {% else%} post {% endif %}
Get a known var
{% if request.GET.my_var %}
Request.GET vars in Django template
{% for key, value in request.GET.items %}
{{key}} = {{value}}
{% endfor %}
If having multiple values with the same key
{%for key, values in request.GET.lists%}
{%for value in values%}
{{value}}
{%endfor%}
{%endfor%}
If debug is true or false in a template
View
from django.conf import settings
def my_view(request):
debug_flag = settings.DEBUG
context = {'debug_flag':debug_flag}
return render(request, "my_app/my_template.html", context )
Template
{% if debug_flag %}
do something
{% else %}
do something
{% endif %}