Is there a way to get the current page URL and all its parameters in a Django template?
For example, a templatetag that would print a full URL like /foo/bar?param=1&baz=2
Is there a way to get the current page URL and all its parameters in a Django template?
For example, a templatetag that would print a full URL like /foo/bar?param=1&baz=2
If we are acessing the following URL: http://127.0.0.1:8000/home/?q=test
then
request.path = '/home/'
request.get_full_path() = '/home/?q=test'
request.build_absolute_uri() = 'http://127.0.0.1:8000/home/?q=test'