I am trying to loop over a dictionary, specifically the request object's meta property. It is a dictionary, but the following code is treating it like it is a list of strings. How can I do this correctly?
EDIT: I found that if I replace request.META with request.META.items, this works, but why does the following not work? Is it not a dict?
{% for a, b in request.META %}
{{ a }}: {{ b }}
{% endfor %}
Yields (this is shortened for brevity):
G: D
w: s
R: U
H: T
G: N
...
L: S
R: E
H: T
P: A
Whereas:
{{request.META}}
Yields:
{'GDM_KEYBOARD_LAYOUT': 'us',
'wsgi.multiprocess': False,
'RUN_MAIN': 'true',
'HTTP_COOKIE': 'sessionid=...
...
...6:*.spx=00;36:*.xspf=00;36:',
'REMOTE_HOST': '',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'PATH_INFO': u'/'}