def redirect(request, name, **kw): router = request.app.router location = router[name].url(**kw) return web.HTTPFound(location=location)