I want to display a certain in the template only if a certain GET variable is set....I thought using {% if request.get.my_var %}
would work, but it's not giving me the results.
views:
19answers:
2
A:
Check if you have django.core.context_processors.request in your TEMPLATE_CONTEXT_PROCESSORS in settings.py! If not put it there, or add request yourself to your rendered context! http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-request
lazerscience
2010-06-05 17:25:35
Yes...I already have that in settings.py
Stephen
2010-06-05 17:33:45
+1
A:
Variables are case-sensitive - so, assuming as lazerscience points out that you actually have the request object in the context, you would need to use {% if request.GET.my_var %}
.
Daniel Roseman
2010-06-05 17:30:17
Ahhhh...that solved my problem. Thnx Daniel...you've saved me several times now
Stephen
2010-06-05 17:43:48