def stripped_db_url(url):
    """Return a version of the DB url with the password stripped out."""
    parsed = urlparse(url)

    if parsed.password is None:
        return url

    return parsed._replace(
        netloc="{}:***@{}".format(parsed.username, parsed.hostname)
    ).geturl()
def stripped_db_url ( url ) : parsed = urlparse ( url ) if parsed . password is None : return url return parsed . _replace ( netloc = "{}:***@{}" . format ( parsed . username , parsed . hostname ) ) . geturl ( )
Return a version of the DB url with the password stripped out.