[Django]-How to pass multiple values for a single URL parameter?

34👍

http://.../?urls=foo&urls=bar&...

request.GET.getlist('urls')

8👍

The following is probably the best way of doing it – ie, don’t specify a delimited list of URLs, rather, use the fact you can specify the same param name multiple times, eg:

http://example.com/?url=http://google.co.uk&url=http://yahoo.com

The URL list be then be used and retrieved via request.GET.getlist('url')

Leave a comment