In my views I want to pass in an error condition.
def something(request):
name = request.GET.get('name')
if name is None:
return render_to_response('myapp.html', {'invalid': 'true'})
Then in my template I want to display different things depending on this.
So I do:
{% if invalid %}
INVALID
{% else %}
ALL OK
{% endif %}
However, the output is:
INVALID
ALL OK
It shows both things - can anyone suggest any reason. Probably somethingstupid I did. But driving me mad.