Skip to content

Instantly share code, notes, and snippets.

@MarrekNozka
Last active February 11, 2022 16:18
Show Gist options
  • Save MarrekNozka/5f8860465f79b5d39a6aea3b211c4aab to your computer and use it in GitHub Desktop.
Save MarrekNozka/5f8860465f79b5d39a6aea3b211c4aab to your computer and use it in GitHub Desktop.
Flask: URLs and path in request object

Flask: URLs and paths in request object

http://www.example.com/myapplication

request. variable content
path u'/π/page.html'
full_path u'/π/page.html?x=y'
script_root u'/myapplication'
base_url u'http://www.example.com/myapplication/π/page.html'
url u'http://www.example.com/myapplication/π/page.html?x=y'
url_root u'http://www.example.com/myapplication/'
  • request.path
  • request.full_path
  • request.script_root
  • request.url
  • request.base_url
  • request.url_root

Old documentation | New documentation

table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment