Flask Redirect

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • redirect(location, code, Response)

Parameters

ParameterDetails
locationThe location the response should redirect to.
code(Optional) The redirect status code, 302 by default. Supported codes are 301, 302, 303, 305, and 307.
Response(Optional) A Response class to use when instantiating a response. The default is werkzeug.wrappers.Response if unspecified.

Remarks

The location parameter must be a URL. It can be input raw, such as 'http://www.webpage.com' or it can be built with the url_for() function.



Got any Flask Question?