title: How to pass argument from template to view in Flask
body: <p>I have template which is doing some operations on fields of table:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;tr&gt;
      {% for field in row %}
          {% if field is link_field %}
              &lt;td&gt;&lt;a href="{{ url_for('munin') }}"&gt;{{ field | table_field | safe }}&lt;/a&gt;&lt;/td&gt;
          {% else %}
              &lt;td&gt;{{ field | table_field | safe }}&lt;/td&gt;
          {% endif %}
      {% endfor %}
  &lt;/tr&gt;
  </code></pre>
  
  <p>To my view:</p>
  
  <pre><code>@app.route("/munin")
  def munin(field):
          return redirect("http://{0}/munin".format(field))
  </code></pre>
  
  <p>I would like to send field from templates.</p>
  
  <p>The whole idea is, to make some fields in the table as a hyperlink to an external site, when the address http of those hyperlinks are attributes of a field (e.g. ip address).</p>
  
  <p>I have tried to do this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;tr&gt;
      {% for field in row %}
          {% if field is link_field %}
              &lt;td&gt;&lt;a href="{{ url_for('munin', field=field) }}"&gt;{{ field | table_field | safe }}&lt;/a&gt;&lt;/td&gt;
          {% else %}
              &lt;td&gt;{{ field | table_field | safe }}&lt;/td&gt;
          {% endif %}
      {% endfor %}
  &lt;/tr&gt;
  </code></pre>
  
  <p>But instead of sending me to site:</p>
  
  <pre><code>http://field/munin
  </code></pre>
  
  <p>it is sending me to:</p>
  
  <pre><code>http://mysite/munin?field=field
  </code></pre>