Differentiating how to display or access variables/structures/dictionaries in Django templates (as opposed to views) can get frustrating. All I was trying to do was print the query string in a template. That's. It. Why couldn't I just do:
{{request.META['QUERY_STRING']}}
Oh yea, because you can't access a dictionary with that notation in templates... FTW! Here's the correct (and hard to find solution).
{{request.META.QUERY_STRING}}
This correctly outputs the whole query string in your template.
Share on Twitter
Share on Facebook