def profile_url_for(entity, _external=False):

    base_url = 'http://{server}' if _external else ''

    profile_url = {
        'multiple': base_url + '/{user}',
        'single': base_url,
        'subdomain': 'http://{user}.{server}',
    }[current_app.user_mode] + '/profile'

    server = current_app.config.get('SERVER_NAME')
    
    return profile_url.format(server=server, user=entity.name)
Get an entity profile url without using url_for
dataset/ETHPy150Open pytent/pytentd/tentd/tests/__init__.py/profile_url_for