title: Django templates: forloop.first and forloop.last
body: <p>I have the following code in my template:</p>
  
  <pre><code>{% for f in friendslist %}
  
          {% if forloop.first %}
              // display something                            
          {% endif %}
  
          // display stuff
  
          {% if forloop.last %}
              // display something
          {% endif %}
  
  {% endfor %}
  </code></pre>
  
  <p>It works as expected when there is more than one item in the friendslist. But if there is just 1 item, then the content inside the forloop.last
  conditional does not display. </p>
  
  <p>I guess this is because the loop in that case is the first, but I mean it's also the last right? So why dosn't both contents inside first and last
  conditional show?</p>