Answer the question
In order to leave comments, you need to log in
Python Flask How to redirect to the previous page?
How to determine the previous page on a new page and redirect to it?
Answer the question
In order to leave comments, you need to log in
return '<script>document.location.href = document.referrer</script>'
If I'm not mistaken
from flask import redirect, request
@app.route('/')
def redirect():
return redirect(request.url, code=302)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question