80258/how-to-get-the-current-url-within-a-django-template
I was wondering how to get the current URL within a template.
Say my current URL is:
.../user/profile/
How do I return this to the template?
Hello @kartik,
You can fetch the URL in your template like this:
<p>URL of this page: {{ request.get_full_path }}</p>
or by
{{ request.path }} if you don't need the extra parameters.
Hope it helps!!
Thank you!!
Hello @kartik, In your profile model provide related_name user ...READ MORE
If you are talking about the length ...READ MORE
FOLLOWING WAY TO FIND CURRENT TIME IN ...READ MORE
>>> import datetime >>> datetime.datetime.now() datetime(2018, 25, ...READ MORE
Hi, there is only that way and ...READ MORE
Hi all, with regard to the above ...READ MORE
Hello @kartik, To turn off foreign key constraint ...READ MORE
Hello @kartik, Let's say you have this important ...READ MORE
Hello kartik, The variation of the context processor ...READ MORE
Hello @kartik, Try this in your queryset: print my_queryset.query For ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.