how can i add active class to image slider dynamically in Django template?

i have an image slider which does not show anything if the image does not have active class on it as it slides through a list of images.

{% for v in m.value.images %}<div class="carousel-item active"> <div class="container">
    <div class="carousel-caption">
      <h1>Another example headline.</h1> </div></div>{% endfor %}