I want to loop through my categories in my html. I am making a filter that will show all of the categories but i cant get my {% for %} to work i need some help heres my code. Ask if theres any more info that you need to solve this.
HTML:
<div class="filter-box">
<h1>Filter</h1><hr>
{% for category in categorys%}
<p class="checkbox-text">Hello</p>
<h1>AAAAAAAAAAAAAAA</h1>
{% endfor %}
</div>
Views:
def category_all(request):
categorys = Category.objects.all()
return render(request, "product/dashboard_test.html", {"names": categorys})
Models:
class Category(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)