title: How to render Django template after ajax call
body: <p>I am Building a application that renders a group of cards based on options clicked by user,
  I am using ajax on option click so that cards appear without page reload, but the problem is I cannot render the cards into my page, I am passing calculated values to frontend as django context using <code>return render(request,'base.html',{'context':context})</code></p>
  <p>Ajax:</p>
  <pre><code>&lt;script&gt;
  function sendData(date){
    $.ajax({
      type : &quot;POST&quot;, 
      url: &quot;&quot;,
      data: {
        date : date,
        csrfmiddlewaretoken:'{{ csrf_token }}',
        click:'click'
      },
  
      });
  
      return false;
  }
  &lt;/script&gt;
  </code></pre>
  <p>view.py:</p>
  <pre><code>def datepicker(request):
      if 'click' in request.POST:
          return render(request,'datepicker.html',{'dates':availabe_dates,'time':time})
      
      return render(request,'datepicker.html',{'dates':availabe_dates,'time':['choose a date']})
  </code></pre>
  <p>I have tried giving:</p>
  <pre><code>&lt;div class=&quot;card-body&quot;&gt;
   {% for t in time %}
      &lt;p&gt;{{t}}&lt;/p&gt;
   {% endfor %}
  &lt;/div&gt;
  </code></pre>
  <p>Only <code>choose a date</code> is shown instead of cards. I am sure that <code>if 'click' in request.POST:</code> is runned as I have tried giving some print statements</p>
  <p>I have tried returning <code>jsonResponse</code> and here is its output <code>{time:Array(14)}</code></p>
  <p>Please Help as I am new to Ajax and Django</p>