I have this class
class Category(models.Model):
title = models.CharField(max_length=60)
created = models.DateTimeField()
def __unicode__(self):
return self.title
class Meta:
verbose_name_plural = "Categories"
I can access its items using Category.objects.all() from my views.py. I want to access these items inside my template, but obviously this doesn't work:
{% for category in Category.objects.all() %}
{{ category }}
{% endfor %}
How can I solve the issue with getting the items in a template?