Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get param from URL after # in python

Tags:

python

django

How can I get param from URL after #?

Example:

http://localhost/addAccount/#code=qwerty

I tried use url = request.path and url.spit('/') but it isn't working becasuse request.path don't read string after # in url.

like image 502
na5tyk Avatar asked Aug 30 '26 07:08

na5tyk


1 Answers

In a URL, what travels after # is known as hash. In an HTTP request that reaches a server (server side) this data does not travel to the server. Therefore, on the server side, it is not possible to retrieve it (web browsers do not send this data in the HTTP request).

However, on the client side it is possible. In Javascript you could do:

window. location. hash

like image 150
Daniel Garrido Avatar answered Aug 31 '26 21:08

Daniel Garrido



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!