title: How can I reload just one div on click?
body: <p>I use Django and Python.</p>
  
  <p>Okay, the context is : </p>
  
  <p>models.py :</p>
  
  <pre><code>class Contacts(models.Model):
      lastname = models.CharField(max_length=150)
      firstname = models.CharField(max_length=150)
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def home(request):
      contacts = Contacts.objects.all()
      return render(request, 'index.html', {'contacts':contacts,})
  
  
  
  def contact(request, contact_id):
      contact = Contacts.objects.get(pk=contact_id)
      return render(request, 'details.html', {'contact':contact,})
  </code></pre>
  
  <p>index.html :</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/style.css"&gt;
  &lt;div class="container"&gt;
  
      &lt;div class="contacts"&gt;
          &lt;ul class="list-contacts"&gt;
              {% for contact in contacts %}
                  &lt;a href="#"&gt;&lt;li class="contact"&gt;{{contact.lastname}}&lt;/li&gt;&lt;/a&gt;
              {% endfor %}
          &lt;/ul&gt;
      &lt;/div&gt;
  
      &lt;div class="details"&gt;
          {% include 'details.html' %}
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>details.html :</p>
  
  <pre><code>{{contact.lastname}} {{contact.lastname}}&lt;br&gt;
  {{contact.phone}}
  </code></pre>
  
  <p>How can I reload just the details div, and not the whole page, when I click on the lastname of one of the contacts in the list (which is actually a link)?
  I know I have to use AJAX, but I have no idea of how to do it. </p>