title: Using JavaScript Onclick Event to pass Data to views.py in Django?
body: <p>I Have a bit of idea about this to use ajax with the JavaScript to send data to views.py but I am not able to do that.</p>
  <p>So what I am trying to do is I have put <code>onclick</code> event on the image so by clicking on that image I should be able to send some value to views.py.</p>
  <p>This is Hello.html file:</p>
  <pre><code>&lt;img src=&quot;&quot; onclick=&quot;change()&quot;&gt;
  </code></pre>
  <p>JavaScript function:</p>
  <pre><code>function change(){
       // Do something here to send data to views.py
   }
  </code></pre>
  <p>Now in views.py</p>
  <pre><code>def SomeFunction():
      //To get data here
      
  </code></pre>