0

I'm having this url parameter:

http://127.0.0.1:8000/information/vimeo/?oauth_token=xxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxx

How can I get the value of oauth_verifier in the url.

Does this code work?

oauth_verifier = request.GET.get('oauth_verifier')

or do I have to mention as reg exp in the urls.py?

I'm sorry for this type of question. I have a long coding and I don't know how to check this particular code in the shell.

Thanks!

2
  • possible duplicate of [Capturing url parameters in request.GET ](stackoverflow.com/questions/150505/…) Commented Jun 20, 2012 at 11:25
  • I saw that question, but I doubt will it work for getting the second parameter I mean oauth_verifier Commented Jun 20, 2012 at 11:31

1 Answer 1

1

If you mention this in urlConf you will get it as a parameter to your view. If not, you will have to use the code you wrote in the question. It's up to you but remember the purpose of using urlConf is to improve url readability.

Sign up to request clarification or add additional context in comments.

1 Comment

Just remember two things: 1. get takes optional parameter - default value that you should use in case the actual parameter was omitted in url. 2. Using this apprach you re bypassing django mechanisms and agree that your urls will be more messy.

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.