Answer the question
In order to leave comments, you need to log in
Using # character in django urls.py?
Good day.
I'm trying to set up OAuth from Yandex, the following problem arose: authorization passes, but after that there is a redirect to the page specified in the settings with a set of parameters (where there is also a token) going through the hash symbol. For example like this:
http://mysite.my/receive_token#access_token=<token>&token_type=bearer&...
url('^receive_token#access_token=(?P<token>.+?)&.*$', 'receive_token')
http://mysite.my/receive_token
, which, of course, it fails to do. Answer the question
In order to leave comments, you need to log in
Fragment IDs are not sent to the server. Never ever.
Too lazy to go into the RFC, but the idea is that URLs that differ only in a fragment are considered to refer to the same document (but to different parts of it), and therefore the server does not care about this.
The oauth mechanism you are trying to use is for client-side (javascript) authorization in some widgets and buttons.
For server authorization, there is another mechanism in which the token is passed differently.
the fact that after the lattice and the lattice itself is not discarded by janga, but by the browser
You can also try putting r (raw string) before the string:
url(r'^receive_token#access_token=(?P<token>.+?)&.*$', 'receive_token')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question