title: How to pass html form variable to python function with django
body: <p>I know this might be a very stupid question, but i'm new to django and try to solve this problem for several houres now. 
  I want to pass a variable from a html form to the backend an then use the variable there to make an api request. 
  Then i want to pass the result of the api-request back to the index.html page.</p>
  
  <p>For example:</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;form action="#" method="post"&gt;
  {% csrf_token %}
  &lt;input type="text" class="form-control" id="city" placeholder="" value=""&gt;
  &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>import requests
  api_address='http://api.openweathermap.org/data/2.5/weather? 
  appid=KEY&amp;q='
  city = FORM-VARIABLE
  url = api_address + city
  json_data = requests.get(url).json()
  kelvin = json_data['main']['temp']
  temperature = round(kelvin - 273.15,0)
  </code></pre>
  
  <p>And then show the temperature in the index.html</p>