title: Passing Variable from HTML to Python/Flask
body: <p>Let me try this again. I want to enter a variable into my HTML form to submit, so far from reading the link here <a href="https://stackoverflow.com/questions/31965558/how-to-display-a-variable-in-html">How to display a variable in HTML</a> I've tried the following code, which is inside of <code>main.html</code></p>
  <pre class="lang-html prettyprint-override"><code>  &lt;form&gt;
        Asset Tag:&lt;br&gt;
        &lt;input type=&quot;text&quot; name=&quot;Asset Tag&quot;&gt;&lt;br&gt;
        &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
        &lt;form action=&quot;{{ asset_tag }}&quot; method=&quot;get&quot;&gt;
    &lt;/form&gt;
  </code></pre>
  <p>I then have a python script that goes like this,</p>
  <pre><code>from flask import Flask, render_template
  app = Flask('server')
  
  @app.route('/py')
  def server():
      return render_template('main.html')
  #API URL
  JSS_API = 'https://apiresource.com'
  
  #Pre-Defined username and password
  username = 'username'
  password = 'password'
  
  #Ask User for the Asset tag
  asset_tag = {{ }}
  </code></pre>
  <p>After the asset tag is entered it just searches through a JSON file for match, the rest doesn't matter so much so I didn't include the next piece of the script.</p>
  <p>So Flask renders my HTML just fine and I can submit a value but it's not being passed back to the script, which makes sense as I'm doing the opposite of the link I provided, but I just can't not think of how it's done. Any suggestions?</p>