[Answered ]-Django url multiple parameter

2👍

This is not how you use GET parameters. You need to access them from the request object. So let’s say you have a function based view, this is how you would access any GET parameters appended to your URL:

def index(request, name='World'):
    search_param = request.GET['search']
    ...

And your url in this case looks like this:

url(r'/(?P<name>.*)', views.index)

A request path in your address bar would then look like:

/Joe?search=search-term

And request.GET['search'] would return "search-term".

Leave a comment