title: Slider in django website using bootstrap4 carousel
body: <p>i want to create a carousel slider in my django website where i could easily add/remove images from my admin panel.</p>
  
  <pre><code>&lt;div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"&gt;
      &lt;ol class="carousel-indicators"&gt;
        &lt;li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"&gt;&lt;/li&gt;
        &lt;li data-target="#carouselExampleIndicators" data-slide-to="1"&gt;&lt;/li&gt;
        &lt;li data-target="#carouselExampleIndicators" data-slide-to="2"&gt;&lt;/li&gt;
      &lt;/ol&gt;
      &lt;div class="carousel-inner"&gt;
          {% for obj in projects %}
              {% if forloop.first %}
                  &lt;div class="carousel-item active  "&gt;
              {% else %}
                  &lt;div class="carousel-item  "&gt;
              {% endif %}
              &lt;img class="d-block w-100 h-50" class="h-50 d-inline-block" src="{{ obj.thumbnail.url}}" alt="{{obj.title}}"&gt;
              &lt;/div&gt;
  
          {% endfor %}
      &lt;/div&gt;
  </code></pre>