def build_url_base(host, port, is_https):
    """
    Make base of url based on config
    """
    base = "http"
    if is_https:
        base += 's'

    base += "://"
    base += host

    if port:
        base += ":"
        base += str(port)

    return base
def build_url_base ( host , port , is_https ) : base = "http" if is_https : base += 's' base += "://" base += host if port : base += ":" base += str ( port ) return base
Make base of url based on config