I've just managed to get my app server hostname in Flask using request.host and request.url_root, but both field return hostname with its port. I want to use field/method that returns only the hostname without having to do string replace, if any.
Building on Juan E's Answer, this was my
Solution for Python3:
from urllib.parse import urlparse
o = urlparse(request.base_url)
host = o.hostname