title: Getting data from JSON to JS
body: <p>In the django function, I send data to JS via JSON</p>
  <pre><code> startdate = datetime.strptime(request.POST['startdate'], '%d.%m.%Y')
   enddate = datetime.strptime(request.POST['enddate'], '%d.%m.%Y')
   paymentparking = paidparking.objects.filter(expirationdate__range = (startdate, enddate)).values('expirationdate',
                                                                                                     'price')
   return JsonResponse(dict(paymentparking))
  </code></pre>
  <p>How do I get price and expirationdate separately in JS?</p>
  <pre><code>$.ajax({
      type: &quot;POST&quot;,
      url: &quot;statistics&quot;,
      data: {
        'startdate': finalDateStrStart,'enddate': finalDateStrEnd,
      },
      dataType: &quot;json&quot;,
      cache: false,
      success:function (data) {
          
          }
      });
  </code></pre>
  <p>This is what I get in the django function before sending the JSON:</p>
  <pre><code>&lt;QuerySet [{'expirationdate': datetime.date(2021, 4, 30), 'price': 300.0}, {'expirationdate': datetime.date(2021, 5, 5), 'price': 750.0}]&gt; 
  </code></pre>
  <p>If success:</p>
  <pre><code>function (data) {
          console.log(data)
          }
  </code></pre>
  <p>As a result, I get:</p>
  <p><a href="https://i.stack.imgur.com/GFGeL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GFGeL.png" alt="enter image description here" /></a></p>
  <p>I need to get the price and expirationdate separately. How can this be done?</p>