How to access url hash/fragment from a Django Requ

2019-02-04 04:02发布

问题:

As in the title: how can I access the url hash/fragment (the part following the dash #) from a Django view and so, I suppose, from a Django Request object?

I've not found enough information on the documentation here available: http://docs.djangoproject.com/en/dev/ref/request-response/

P.S. Suppose that the fragment part is sent to the server (it is so in my specific case since it's not a browser to send the request).

回答1:

This is not sent to the server, by definition. From URI References: Fragment Identifiers on URIs :

"The HTTP engine cannot make any assumptions about it. The server is not even given it."