E
E
epolyak2019-06-14 13:29:50
Django
epolyak, 2019-06-14 13:29:50

How to process URL correctly in django?

The html page has a link like this

<a href="https://oauth.vk.com/authorizev=5.95&display=page&response_type=token&client_id=7002915&scope=wall&redirect_uri=https://xxxx.ru/main/redirect/">линк</a>

answer
https://vk-xxxx.ru/main/redirect/#access_token=3faeb619b38ertyy2d5b056a334yytrr9ec200fbfa3a82rrrrrd53567c908ce7f007f7bad8deb63ff70af&expires_in=86400&user_id=56778998

hits such a url https://xxxx.ru/main/redirect/
there is a corresponding View:
def redirect(request):
      return render(.....)

How can I get the contents of the URL after # in this View (see URL in the answer)
?
Or am I doing something wrong?
No need to ask why I do not use the appropriate batteries - the question is purely academic for me - thank you

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pcdesign, 2019-06-14
@epolyak

How can I get the contents of the URL after # in this View

You can use js to pull this parameter:
https://stackoverflow.com/questions/23699666/javas...
And then send it ajax to the server, for example.

S
Sergey Gornostaev, 2019-06-14
@sergey-gornostaev

No way, browsers don't pass this part to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question