Do you have to return the message explicitly in the url or save it in a cookie? A redirect () is a response, telling the browser to go load a different URL, the form object is not something you can easily cram into a URL path element. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Replace first 7 lines of one file with content of another file. Sort: Best Match . Why are there contradicting price diagrams for the same ETF? They are rendered on the results page using a for loop to print the field of each object. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks. statuscode sent to browser's header, defaults to 302. response parameter is used to instantiate response. statuscode sent to browser's header, defaults to 302. Will it have a bad influence on getting a student visa? Parameters can be used when creating routes. If you don't need to see a different URL in the browser location bar, don't use a redirect but simply call a different function: Is there a term for when you use grammar from one language in another? In it, we get the the URL parameters from the found function's parameters.22-May-2022. Does Ape Framework have contract verification workflow? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. A redirect() is a response, telling the browser to go load a different URL, the form object is not something you can easily cram into a URL path element. Something like this: @app.route ('/test2') def test2 (): return {'url': 'https://youtube.com'} Then in javascript (semi pseudo code): const data = await fetch ('/test') const newUrl = data . Best Match; Relevance; Date; Quality Score; Views; Up Votes; redirect parameters flask . App Routing means mapping the URLs to a specific function that will handle the logic for that URL. If this is what you were looking for then feel free to upvote and/or accept the answer. In Flask, how can I redirect to a profile being clicked? Table of contents We will see. If you don't need to see a different URL in the browser location bar, don't use a redirect but simply call a different function: If you do need a different URL in the browser, then have the