I want to pass a large list between views in Flask however I can't put it in a session because it exceeds the 4096 bytes limit. Is there a way to pass a list between pages through something like a form such as this?
Python:
@app.route('/send')
def send():
list = ['item1', 'item2', 'item3', 'item4']
return render_template('send.html', list=list)
@app.route('/receive', methods=['POST', 'GET'])
def receive():
list = request.form['list']
return render_template('receive.html')
send.html:
<form method="POST" action="{{ url_for('receive') }}">
<input type="text" name="list" value="{{ list }}">
<submit>Submit</submit>
</form>
Would this work? Thanks.