A
A
Alexey Poloz2018-03-20 19:16:07
Flask
Alexey Poloz, 2018-03-20 19:16:07

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

3 answer(s)
A
Alexey Poloz, 2018-03-20
@kosyachniy

return '<script>document.location.href = document.referrer</script>'

T
ThemeZV, 2018-03-20
@ThemeZ

Pass get as parameter

@
@ progrems2334, 2018-03-20
@progrems2334

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 question

Ask a Question

731 491 924 answers to any question