Reputation: 859
I'm using Django to create a website, and in one portion I need two get requests in the url - one called "search", and one called "page". I've tried the following -
return HttpResponseRedirect('/explore/?search=test/?page=1')
However, '/?page=1' is being included as part of the search, and this is messing it up. Any way to keep them as two different gets, or will I have to fuse them into one?
Upvotes: 1
Views: 307
Reputation: 39649
Do it like this:
return HttpResponseRedirect('/explore/?search=test&page=1')
and in view you can get both parameters as:
search = request.GET.get('search')
page = request.GET.get('page')
Upvotes: 4