def api_url_for(view_name, _absolute=False, _xml=False, _internal=False, *args, **kwargs):
 renderer = ('XMLRenderer' if _xml else 'JSONRenderer')
 url = url_for('{0}__{1}'.format(renderer, view_name), *args, **kwargs)
 if _absolute:
  domain = (website_settings.INTERNAL_DOMAIN if _internal else website_settings.DOMAIN)
  return urlparse.urljoin(domain, url)
 return url

def api_url_for ( view_name , _absolute = False , _xml = False , _internal = False , * args , ** kwargs ) : renderer = ( 'XMLRenderer' if _xml else 'JSONRenderer' ) url = url_for ( '{0}__{1}' . format ( renderer , view_name ) , * args , ** kwargs ) if _absolute : domain = ( website_settings . INTERNAL_DOMAIN if _internal else website_settings . DOMAIN ) return urlparse . urljoin ( domain , url ) return url
reverse url lookup for api routes .