Every line of 'flask redirect with parameters' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
177 def redirect_with_query(redirect_uri, params): 178 """Return a Bottle redirect to the given target URI with query parameters 179 encoded from the params dict. 180 """ 181 return redirect(redirect_uri + '?' + urllib.urlencode(params))
14 def redirect(request): 15 return HttpResponseRedirect('/')
14 def redirect_view(request): 15 return HttpResponseRedirect(target)
68 def redirect(url, status='301 Moved Permanently'): 69 """ 70 Returns a `status` redirect to the new URL. 71 `url` is joined with the base URL so that things like 72 `redirect("about") will work properly. 73 """ 74 newloc = urlparse.urljoin(web.ctx.path, url) 75 76 # if newloc is relative then make it absolute 77 #mvoncken:Disabled because we don't want to redirect to localhost! 78 #mvoncken:back to http-spec, maybe better. 79 if newloc.startswith('/'): 80 newloc = web.ctx.home + newloc 81 82 web.ctx.status = status 83 web.ctx.output = '' 84 web.header('Content-Type', 'text/html') 85 web.header('Location', newloc)
10 def test_redirect_to_redirects_to_same_location_of_redirect(self): 11 # assert 12 assert redirect_to('home').location == redirect(url_for('home')).location