title: Passing value from html input to python script with Django
body: <p>So basically what I have been trying to figure out is how to pass the value from the form into a python script with Django.</p>
  
  <p>Here is my form code, I want to pass that value of stateLand into the python script.</p>
  
  <pre><code>&lt;form action= '*******' method="POST"&gt;
  {% csrf_token %}
      Land: &lt;input type="text" name="stateLand" /&gt;
      &lt;/br&gt;
      &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my view.</p>
  
  <pre><code>def ar(request):
      if request.method == 'POST':
          from raids import state
          x = state("","")
          return render(request, 'ar.html', {'state':x.main('24000')})
      else:
          return render(request, 'ar.html')
  </code></pre>
  
  <p>Right now I have just 24000 hard coded into the script. I have tried many things to get this to work but none have seemed to help. Any suggestions you guys have to make this work? The python script runs some calculations on the number entered.</p>
  
  <p>I've tried different things like</p>
  
  <pre><code>request.POST.get('stateLand')
  
  stateLand  = form.getvalue("stateLand")
  
  import cgi
  form = cgi.FieldStorage()
  stateLand = form["stateLand"]
  </code></pre>