I have a simple Django view that just returns URL parameters, but if I use the same parameter key multiple times, I cannot seem to access it. Consider the following set-up:
urls.py:
(r'^header/$',header)
View function:
def header(request)
return render_to_response('header.html',locals(),mimetype='text/plain')
Template:
{{ request.GET }}
{% for key,val in request.GET %}
{{ key }} : {{ val }}
{% endfor %}
URL:
http://mysite/header/?item=1&item=2
Response:
<QueryDict: {u'item': [u'1', u'2']}>
item : 2
Should the 'item' entry have the value of '1,2' or "['1','2']"? Notice what the full GET returns. How do I get both values?