(noob question I know) Hi everybody, I keep having a problem with the count() function. In my website I added some items to the database, then I'd like to show on the hompage the number of items, but the count doesn't show up. I really can't figure out what I'm doing wrong.
this is the code: View.py:
class homeView(TemplateView):
template_name = 'search/home.html'
def conto(self):
album = Info.objects.all().count()
return album
Html file:
<h3 style="text-align:center;"> ALBUM TOTALI: {{album}} </h3>
get_context_data()method.