• 1997 views
  • 0 comments
  • loading...

The most common way to use redirect is to redirect to other pages

The named arguments of the HTTP initializer method are translated into HTTP header directives, in this case, the redirection target location. redirect takes an optional second argument, which is the HTTP status code for the redirection (303 by default). Change this number to 302 for a temporary redirect or 301 for a permanent redirect. The most common way to use redirect is to redirect to other pages in the same app and (optionally) pass parameters:
redirect(URL('index', args=(1,2,3), vars=dict(a='b')))

Attributes / Arguments

If the called action performs a redirect, you may want the Ajax request to follow the redirect or you may want the entire page performing the Ajax request redirecting. In this latter case you can set:

redirect(...,client_side=True)


Examples

loading...


Comments

loading...

Powered by
Web2py

Hosted on
www.pythonanywhere.com
(affiliated link)