(to)
return _redirect
Create a 301 redirect WSGI app.

    `to` may contain str.format-style formatting which'll be formatted against
    the routing arguments (wsgiorg.routing_args).
Create a 301 redirect WSGI app.
Create a 301 redirect WSGI app .
def redirect(to):
    """
    Create a 301 redirect WSGI app.

    `to` may contain str.format-style formatting which'll be formatted against
    the routing arguments (wsgiorg.routing_args).
    """
    def _redirect(environ, start_response):
        args, kwargs = environ['wsgiorg.routing_args']
        start_response('301 MOVED PERMANENTLY',
                       [('Location', to.format(*args, **kwargs))])
        return []
    return _redirect
def redirect ( to ) : def _redirect ( environ , start_response ) : args , kwargs = environ [ 'wsgiorg.routing_args' ] start_response ( '301 MOVED PERMANENTLY' , [ ( 'Location' , to . format ( * args , * * kwargs ) ) ] ) return [ ] return _redirect