How to get current url in Google App Engine python with jinja template

I am using Google App Engine for Python with Jinja2 template. Is there a template tag to get the url of the current page. Or do I need to pass the url as a variable to the template from the view code?

+3


source to share


1 answer


{{ request.url }}

gives the current url. Do you need the full url or just the root path?

For example, using a checkbox, you can have



{{ request.url }}
{{ request.base_url }}
{{ request.url_root }}
{{ request.host_url }}
{{ request.path }}

      

and etc.

+7


source







All Articles