title: Django post on click with jquery not getting a response
body: <p>I am trying to setup a button on my website that when clicked a new model item is saved to the database. Segments of my code are pasted below and I will discuss the problem after.</p>
  
  <p>textbook.html</p>
  
  <pre><code>&lt;script src="../../static/textchange/wishlisting.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;input type="button" id="addwishlist" value="Add to Wishlist"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>wishlisting.js</p>
  
  <pre><code>$('#addwishlist').click(function() {
  $.ajax({
      url: '/textbook/',
      method: 'POST', // or another (GET), whatever you need
      data: {
          name: request.user,
          book: text, // data you need to pass to your function
          click: True
      }
      success: function (data) {
          // success callback
          // you can process data returned by function from views.py
      }
  });
  </code></pre>
  
  <p>});</p>
  
  <p>views.py </p>
  
  <pre><code>def textbook(request, uisbn):
      form4 = AddWishlist(request.POST or None)
      ltextbook = Textbook.objects.filter(isbn = uisbn)
      text = ltextbook[0]
      wishlists = Wishlist.objects.filter(textbook = text)
      listings = Posting.objects.filter(textbook = text)
      if request.POST.get('click', False):
          new = Wishlist(textbook = text, user = name, wish_date = datetime.now())
          new.save()
  </code></pre>
  
  <p>From my understanding when I click the "Add to Wishlist" button it should correlate that id with the id of the jquery referenced in wishlisting.html and then the view should be loaded and the database item should be made. What am I missing in my thought process?</p>
  
  <p>Thanks.</p>