In python flask, I want to change value obtained by POST method for redirect other route.
@app.route('/nextpage', methods=['POST'])
def nextpage():
page = int(request.form['page'])
page = cb.next_page(page)
return redirect(url_for('community'), code = 307)
from this code, the 'page' variable is changed to the value returned by cb.next_page(page)
@app.route('/community', methods=['POST'])
def community():
page = int(request.form['page'])
docs, page = cb.show(page)
return render_template('community.html', posts = docs, ID = ID, page = page)
and in this route, i want request.form['page'] be the value recieved by cb.next_page(page)
, not the same value as the first.
How can I do it without changing the method to 'GET'? Please help.