0

In a Djano project, I need to get the complete URL of my web app in a view, along with the URL's anchor tag. For instance, if the URL is:

http://example.com/#section0

I need to get that in its entirely, including the #section0 part. As you'd already know, HTTP_REFERER doesn't suffice (which is what I've tried).

What's a good way to read URLs in python/django? Beginner here, please advise.

Colin Basnett
  • 4,052
  • 2
  • 30
  • 49
Hassan Baig
  • 15,055
  • 27
  • 102
  • 205

1 Answers1

1

Sorry, but the anchor tag is never sent to the server. The only way a server could know what it was is if the server itself sent the user to a url with the anchor tag. See here for more information:

Is the anchor part of a URL being sent to a web server?

Community
  • 1
  • 1
MattCorr
  • 371
  • 3
  • 11