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!

rnk
  • 2,174
  • 4
  • 35
  • 57
  • possible duplicate of [Capturing url parameters in request.GET ](http://stackoverflow.com/questions/150505/capturing-url-parameters-in-request-get) – mVChr Jun 20 '12 at 11:25
  • I saw that question, but I doubt will it work for getting the second parameter I mean `oauth_verifier` – rnk Jun 20 '12 at 11:31

1 Answers1

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.

okm
  • 23,575
  • 5
  • 83
  • 90
mnowotka
  • 16,430
  • 18
  • 88
  • 134
  • 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. – mnowotka Jun 20 '12 at 11:32