Redirect with Pyramid View.
@view_config(route_name="method")
def method(request):
@view_config(route_name="redirect")
def redirect(request):
return HttpFound(location=request.route_url('method'))
Since a simple method call does not result in a redirect, use the HttpFound class as described above.