title: Template does not show html content
body: <blockquote>
    <p>TemplateSyntaxError at /deals/amp-stories Invalid block tag on line 576: 'else', expected 'empty' or 'endfor'. Did you forget to register or load this tag? </p>
    
    <p>Request Method:   GET Request</p>
    
    <p>URL:  <a href="http://localhost:8001/deals/amp-stories?card_ids=1" rel="nofollow noreferrer">http://localhost:8001/deals/amp-stories?card_ids=1</a> Django</p>
    
    <p>Version:  2.2.7 Exception Type: TemplateSyntaxError Exception Value:<br>
    Invalid block tag on line 576: 'else', expected 'empty' or 'endfor'.
    Did you forget to register or load this tag?</p>
  </blockquote>
  
  <p>I am trying to create a view that will load a template view in django and I am getting the above error. </p>
  
  <pre><code>&lt;body&gt;
      &lt;!-- supports-landscape --&gt;
      {% if card_list %}
          &lt;amp-story standalone title="Best islands to visit from Guernsey" publisher="add here" publisher-logo-src="add here" poster-portrait-src="add-logo" poster-square-src="add-logo-here" poster-landscape-src="add-logo-here" supports-landscape&gt;
              {% for card in card_list %}
                  &lt;amp-story-page id="slide_3" class="i-amphtml-element i-amphtml-layout-container i-amphtml-layout i-amphtml-story-page-loaded" i-amphtml-layout="container" aria-label="null" distance="0" i-amphtml-visited="" active=""&gt;
                      &lt;amp-story-grid-layer template="fill" class="zoomIn i-amphtml-element i-amphtml-layout-container i-amphtml-story-layer i-amphtml-story-grid-template-fill i-amphtml-layout" i-amphtml-layout="container"&gt;
                          &lt;amp-img src="{{card.card_image}}" width="1080" height="1920" class="i-amphtml-element i-amphtml-layout-fixed i-amphtml-layout-size-defined i-amphtml-layout" i-amphtml-layout="fixed" style="width: 1080px; height: 1920px; --loader-delay-offset:6ms !important;" i-amphtml-auto-lightbox-visited=""&gt;
                              &lt;img decoding="async" src="{{card.card_image}}" class="i-amphtml-fill-content i-amphtml-replaced-content"&gt;
                          &lt;/amp-img&gt;
                      &lt;/amp-story-grid-layer&gt;
                      &lt;div class="i-amphtml-story-spinner" aria-hidden="true" aria-label="Loading video"&gt;
                          &lt;div class="i-amphtml-story-spinner-container"&gt;
                              &lt;div class="i-amphtml-story-spinner-layer"&gt;
                                  &lt;div class="i-amphtml-story-spinner-circle-clipper left"&gt;&lt;/div&gt;
                                  &lt;div class="i-amphtml-story-spinner-circle-clipper right"&gt;&lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/amp-story-page&gt;
              (% endfor %)
      {% else %}
          &lt;p&gt;There are no cards in the collection.&lt;/p&gt;
      {% endif %}
      &lt;/amp-story&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class StoryList(ListView):
      model = Card
      context_object_name = "all_cards"
      template_name = "card_list.html"
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>urlpatterns = [    
      path('amp-stories', StoryList.as_view(), name='ampstories'),
  ]
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class Card(models.Model):
      tag = models.ManyToManyField(CardTag)
      card_name = models.CharField(max_length=200)
      card_image =models.ImageField(upload_to='slides')
      card_createdate = models.DateTimeField(auto_now=True)
  
  
      class Meta:
          ordering = ['card_name']
  
      def __str__(self):
          return self.card_name
  
      def slide_thumbnail(self):
          return html.format_html(u'&lt;img src="'+settings.HOSTNAME+'%s" width="100px"/&gt;' % (self.card_image.url))
  
      slide_thumbnail.short_description = 'Thumbnail'
  </code></pre>