(url, code=303)
Aborts execution and causes a 303 redirect
Aborts execution and causes a 303 redirect
Aborts execution and causes a 303 redirect
def redirect(url, code=303):
    """ Aborts execution and causes a 303 redirect """
    scriptname = request.environ.get('SCRIPT_NAME', '').rstrip('/') + '/'
    location = urljoin(request.url, urljoin(scriptname, url))
    raise HTTPResponse("", status=code, header=dict(Location=location))
def redirect ( url , code = 303 ) : scriptname = request . environ . get ( 'SCRIPT_NAME' , '' ) . rstrip ( '/' ) + '/' location = urljoin ( request . url , urljoin ( scriptname , url ) ) raise HTTPResponse ( "" , status = code , header = dict ( Location = location ) )