title: Flask: call function with parameters from form action
body: <p>in <code>routes.py</code> I have a function:</p>
  
  <pre><code>@app.route('/')
  @app.route('/makecsc_relocation') 
  def makecsc_relocation(csc_post_index):
      ... 
      makeCscRelocationRep(repname, csc_post_index)
      return send_file(repname+'.xlsx', as_attachment=True, attachment_filename=repname+' '+csc_post_index+'.xlsx')
  </code></pre>
  
  <p>in <code>index</code>, I have the following:</p>
  
  <pre><code>@app.route('/')
  @app.route('/index')
  def index():
  ...
  sForm = """&lt;form action="makecsc_relocation"&gt;
                               Enter postal code here: &lt;input type="text" name="post_index" value=""&gt;&lt;br&gt;
                               &lt;input type="submit" value="Download report" &gt;&lt;br&gt;
                               &lt;/form&gt;"""
  </code></pre>
  
  <p>If I use function that has no parameters in <code>&lt;form action=""&gt;</code> and pass to it an empty <code>input</code> value, everything works fine, but as I tried to pass <code>input post_index</code> as an argument to that function, I get Internal Server Error with following URL:
  <code>http://myservername/makecsc_relocation?post_index=452680</code></p>
  
  <p>How do I fix that?</p>