title: Pass Dynamic Javascript Variable to Django/Python
body: <p>I have looked at a number of answers and other websites, but none answer my specific question. I have a webpage with "+" and "-" buttons, which should increment a variable called "pieFact". This variable must be updated dynamically without having to refresh the page. It should then be passed to my Django view each time the value is changed. This will be used to update the size of pie charts in a web map. I have the following:</p>
  
  <pre><code>&lt;button type="button" id=bttnMinus onclick="pieFact=pieFact*0.9"&gt;-&lt;/button&gt;
  &lt;button type="button" id=bttnPlus onclick="pieFact=pieFact*1.1"&gt;+&lt;/button&gt;&lt;/td&gt; 
  &lt;script type="text.javascript"&gt;
      var pieFact=0;
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I pass the value of "pieFact" to Django? Based on my limited knowledge, I think I may have to use AJAX post/get.</p>