title: How to count total objects in a django model
body: <p>I am trying to get a total number of items in my model which I will be displaying in my base template as a footer. here's my code. After applying this code my HTML template does not show me the value of the total items but also it didn't show any error too.</p>
  <p>VIEW:</p>
  <pre><code>def showthis(request):
      
      count= Item.objects.all().count()
      
      context= {'count': count}
          
      return render(request, 'waqart/footer.html', context)
  </code></pre>
  <p>TEMPLATE:</p>
  <pre><code>&lt;h1 class=&quot;text-4xl md:text-6xl text-gray-700 font-semibold&quot;&gt;UX/UI Components {{count}}&lt;/h1&gt;
  </code></pre>