title: Render Django Template after AJAX POST
body: <p>I'm using <code>django</code> and <code>ajax</code> to build a small app.</p>
  <p>I send some data by ajax:</p>
  <pre class="lang-js prettyprint-override"><code>// send search post when clicking the button
  $(&quot;#search-button&quot;).click(function(){
      $.post(
          &quot;{% url 'search-index' %}&quot;,
          {
              query: $(&quot;#query&quot;).val()
          },
          function(data, status){
              console.log(&quot;success&quot;)
          }
      )
  })
  </code></pre>
  <p>And I generate some new data according to the <code>query</code>, which I'd like to display in the html template:</p>
  <pre class="lang-py prettyprint-override"><code>def view(request):
      if request.method == &quot;POST&quot;:
          query = request.POST[&quot;query&quot;]
          hits = search(query)
  
          return render(request, &quot;search/index.html&quot;, {&quot;hits&quot;: hits})
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>{% if hits %}
      &lt;div class=&quot;container&quot;&gt;
      {% for hit in hits %}
          &lt;div&gt;
              &lt;a href=&quot;&quot;&gt;{{ hit.title }}&lt;/a&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;p&gt;{{ hit.abstract }}&lt;/p&gt;
          &lt;/div&gt;
      {% endfor %}
      &lt;/div&gt;
  {% endif %}
  </code></pre>
  <p>However, I find <code>django</code> is not rendering the template, I got an empty html page after this post request. <strong>I don't want to append the data using jquery. I prefer to modify the html in the template.</strong></p>
  <p>Any solution? Thanks in advance.</p>