1

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?

1
  • 1
    '/explore/?search=test&page=1' ?? if you ment "get params" Commented Aug 24, 2012 at 20:57

1 Answer 1

4

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')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.