Reputation: 245
I know there is another question with virtually the same title as mine but the solution in that one didn't work for me. My url is like this:
http://domain.com/videos/dvd/1/
If I use either {{baseurl}}
or {{ request.get_full_path }}
I get just this part:
http://domain.com/videos/
How can I get the entire url? I need to be able to do this from the template level.
P.S. it should disregard any parameters that may be in the url.
Upvotes: 5
Views: 6198
Reputation: 77415
You could get it in your view and pass it along into your template context so that it is available to you there.
full_url = request.build_absolute_uri(None)
# pass full_url into the template context.
Upvotes: 9