I have a website that uses a form to gather data, compute and output some new data on another page. My form and calculations work perfectly, placing all the information needed into a list 't'. However, when I hit submit and move to the next html I can't figure out how to carry the list with me so that I can display the information I want. I found another thread that mentions what I want to do in the answer but haven't been able to figure it out. Any help would be appreciated.
Redirect with data parameter in flask
routes.py
@app.route('/tcalc', methods=["GET", "POST"])
def tcalc():
form = TCalcForm()
if form.validate_on_submit():
lng1 = form.lng1.data
qty1 = form.qty1.data
...
t = [t1, t2, t3]
return redirect("/tdata")
return render_template('tcalc.html', form=form)
@app.route('/tdata')
def tdata():
t = t
return render_template('tdata.html', t=t)