0

I'm looking for all of the associated attributes for the Jinja2 request globals variable and I can't seem to find it listed in the documentation.

I'm trying to print out the url without any pages within my meta tag by doing such:

<meta property="og:url" content="{{ request.url_rule }}" />

But this prints out the URL with any associated pages (ie. '/contact', etc). I know that I could just define this as a globals variable myself easily but I wanted to see the proper way of doing such and avoid defining extra variables.

Is there a way to print out the base URL from the request variable?

davidism
  • 110,080
  • 24
  • 357
  • 317
Joey Orlando
  • 1,308
  • 1
  • 16
  • 32

1 Answers1

0

request.url_root - from Flask.request object

The full URL root (with hostname), this is the application root as IRI. See also: trusted_hosts.

Joey Orlando
  • 1,308
  • 1
  • 16
  • 32