I'm new to Python/Flask. I need to pass the dictionary in "cmz" function called "dict" to the "form" function in order to call a html template an pass the same dictionary to the page. I'm stuck because when I run it I get only a string value instead of an object.
I tried to set the '**' before the argument "params" of "form" function but it doesn't work to me.
This is my code, thanks to anyone for any advice!
@app.route('/form<params>')
def form(params):
return render_template('index.html', result = params)
@app.route('/page/<distrib>')
def cmz(distrib):
if distrib == "cmz":
dict = {'aaa' : 'bbb', 'ccc' : 'ddd'}
return redirect(url_for('form', params = dict))