title: The easiest way to pass multiple variable from 2 files html with Flask
body: <p>I'm triyng to understand how Flask works.
  I have this script running on my local machine:</p>
  
  <pre><code>@app.route('/ordini', methods=['GET', 'POST'])
  def ordini():
      global data_start, ora_start, data_stop, id, M1, M2, M3, M4, M5
  
          if request.method == 'POST':
  
               id = request.form['id']
               data_start = request.form['data_start']
               ora_start = request.form['ora_start']
               data_stop = request.form['data_stop']
  
               M1 = request.form['M1']
               M2 = request.form['M2']
               M3 = request.form['M3']
               M4 = request.form['M4']
               M5 = request.form['M5']
  
               return render_template('ordine_macchine_necessarie.html',
                                      id=id, data_start=data_start, 
                                      data_stop=data_stop,                            
                                      ora_start=ora_start, 
                                      M1=M1, M2=M2, M3=M3, M4=M4, M5=M5)
  
  return render_template('ordine.html')
  </code></pre>
  
  <p>Every thing works just fine, I get the values from the <code>ordine.html</code> and I pass them to <code>ordine_macchine_necessarie.html</code> but in my opinion I'm not passing the values in the correct way.
  Do I really have to set all the variables like <code>id = request.form['id']</code> and then pass all of them like <code>id=id</code> ?
  I can imagine forms composed by 50 or more values, I'm pretty sure that I'm not doing something correctly..</p>
  
  <p>Maybe is better if I start to learn Django instad Flask? some users says that it is better!</p>