

def dispatch_url(self, url_string):
    'Dispatch the URL string to the target endpoint function.\n\n        :param url_string: the origin URL string.\n        :returns: the return value of calling dispatched function.\n        '
    (url, url_adapter, query_args) = self.parse_url(url_string)
    try:
        (endpoint, kwargs) = url_adapter.match()
    except NotFound:
        raise NotSupported(url_string)
    except RequestRedirect as e:
        new_url = '{0.new_url}?{1}'.format(e, url_encode(query_args))
        return self.dispatch_url(new_url)
    try:
        handler = import_string(endpoint)
        request = Request(url=endpoint, args=query_args)
        return handler(request, **kwargs)
    except RequestRedirect as e:
        return self.dispatch_url(e.new_url)

dataset/ETHPy150Open douban/brownant/brownant/app.py Brownant.dispatch_url/VarMisuse@105/210 `url`->`endpoint`