I am aware of how to get the request parameters from a url using Flask Request: request.args.get('<param>')
. Indeed, that's the only thing I can find when searching for the title question:
- How do you get a query string on Flask?
- How to pass a URL parameter using python, Flask, and the command line
I need to know how to send the request parameter for the user's url.
For example, flask_login has a parameter called "next" that stores the url the user was accessing when they accessed a route wrapped in @login_required so that they can be redirected to it after they log in. I have need of this exact functionality with my own forms but I cannot find a way to do implement it.
The relevant section of the flask-login code is here, but I cannot understand how they pass the parameter.
I need a way to record the user's url when they click a link to a form page, pass that as a GET request parameter in their url on the form page, and reaccess it when they submit or cancel the form to return them to their previous page.