title: NoReverseMatch at /product/pussyes/ Reverse for 'basket_adding' not found. 'basket_adding' is not a valid view function or pattern name
body: <blockquote>
    <p>NoReverseMatch at /product/pussyes/</p>
    
    <p>Reverse for 'basket_adding' not found. 'basket_adding' is not a valid view function or pattern name.</p>
    
    <p>Request Method:    GET
    Request URL:   <a href="http://127.0.0.1:8000/product/pussyes/" rel="noreferrer">http://127.0.0.1:8000/product/pussyes/</a>
    Django Version:    1.11
    Exception Type:    NoReverseMatch
    Exception Value:   </p>
    
    <p>Reverse for 'basket_adding' not found. 'basket_adding' is not a valid view function or pattern name.</p>
  </blockquote>
  
  <p>error with ajax and jquery </p>
  
  <h1>this is my url in folder orders</h1>
  
  <pre><code>url(r'^basket_adding/$', basket_adding, name="basket_adding"),
  </code></pre>
  
  <h1>this is my views.py of prodcuts</h1>
  
  <pre><code>def product_view(request, slug=None):
      instance                        = get_object_or_404(Product, slug=slug)
      title                           = instance.name
      session_key                     = request.session.session_key
      if not session_key:
          request.session.cycle_key()
      forms                           = SubscribersForm(request.POST or None)
      if forms.is_valid():
          instance                    = forms.save(commit=False)
          instance.save()
          return redirect("/")
      context = {
                  "instance": instance,
                  "title": title,
                  "forms": forms,
      }
      return render(request, 'product.html', context)
  </code></pre>
  
  <h1>this is my views.py of orders</h1>
  
  <pre><code>def basket_adding(request):
      return_dict                     = {}
      session_key                     = request.session.session_key
      data                            = request.POST
      product_id                      = data.get('product_id')
      product_price                   = data.get('product_price')
  
      new_product                     = ProducInBasket.objects.get(session_key=session_key, product_id=product_id, product_price=product_price, quantity=quantity)
      return JsonResponse(return_dict)
  </code></pre>
  
  <h1>this is my models of orders</h1>
  
  <pre><code>class ProducInBasket(models.Model):
      session_key                         = models.CharField(max_length=128, default=None)
      order                               = models.ForeignKey(Order, blank=True, null=True, default=None)
      product                             = models.ForeignKey(Product, blank=True, null=True, default=None)
      count_of_goods                      = models.IntegerField(default=1)
      price_per_item                      = models.DecimalField(max_digits=10, decimal_places=2, default=0)
      total_price                         = models.DecimalField(max_digits=19, decimal_places=2, default=0)
      is_active                           = models.BooleanField(default=True)
      publish                             = models.DateField(auto_now=False, auto_now_add=True)
      timestamp                           = models.DateTimeField(auto_now=False, auto_now_add=True)
  
  
      def __str__(self):
          return "{0}:|:{1}".format(self.price_per_item,self.order) 
  
      class Meta:
          ordering = ["-timestamp"]
          verbose_name = 'Product in Basket'
          verbose_name_plural = 'Products in Basket'
  </code></pre>
  
  <h1>this is my template where is located the url basket_adding</h1>
  
  <pre><code>&lt;form class="form-group formselect" action="{% url 'basket_adding' %}"&gt; {% csrf_token %}
                      &lt;label&gt;Quantity&lt;/label&gt;
                        &lt;select class="form-control litlwidth" id="sel1" &gt;
                          &lt;option value="1"&gt;1&lt;/option&gt;
                          &lt;option value="2"&gt;2&lt;/option&gt;
                          &lt;option value="3"&gt;3&lt;/option&gt;
                          &lt;option value="4"&gt;4&lt;/option&gt;
                          &lt;option value="5"&gt;5&lt;/option&gt;
                          &lt;option value="6"&gt;6&lt;/option&gt;
                          &lt;option value="7"&gt;7&lt;/option&gt;
                          &lt;option value="8"&gt;8&lt;/option&gt;
                          &lt;option value="9"&gt;9&lt;/option&gt;
                          &lt;option value="10"&gt;10&lt;/option&gt;
                        &lt;/select&gt;
                      &lt;br&gt;
                      &lt;button id="submit_btn" class="cartadd morewidth"  title="Add to Cart" type="submit" &gt;Add to Cart&lt;/button&gt;
                      &lt;p class="info hidden" data-product_id="{{ instance.id }}" data-product_name="{{ instance.name }}" data-product_price="{{ instance.price }}"&gt;&lt;/p&gt;
  
                  &lt;/form&gt;
  </code></pre>
  
  <h1>this is jquery code with ajax</h1>
  
  <pre><code>$(document).ready(function() {
  
      var newcount                = 0;
      var allprice                = 0;
      var btnn                    = $("#submit_btn");
      var form                    = $(".formselect");
          form.on('submit', function(e) {
          e.preventDefault();
          var product_id          = $(".info").data("product_id");
          var product_name        = $(".info").data("product_name");
          var price               = $(".info").data("product_price");
          var quantity            = $("#sel1").val();
          var full_price_per_item = (price * quantity)
          newprice                = allprice + (price * quantity );
          allprice                = newprice
          newcount++;
          $(".count").html(newcount);
          $("#price").html(newprice);
  
  
          ////////////////////////////////////////////////
          var data                = {};
          /////////////////////////////
  
          data.product_id         = product_id;
          data.product_name       = product_name;
          data.product_price      = price;
          data.product_quantity   = quantity;
          data.product_newprice   = newprice;
          data.product_newcount   = newcount;
          data.product_allprice   = allprice;
  
          /////////////////////////////
  
  
          var csrf_token          = $('.formselect [name="csrfmiddlewaretoken"]').val();
          data["csrfmiddlewaretoken"] = csrf_token;
          var url                 = form.attr("action");
          console.log(data)
          $.ajax({
              url: url,
              type: 'POST',
              data: data,
              cache: true,
              success: function(data){
                  console.log("OK");
              },
              error: function(){
                  console.log("ERROR");
  
              },
          });
  </code></pre>