def product_list(request, category_slug = None):
category = None
categories = Category.objects.all()
products = Products.objects.filter(available=True)
if category_slug:
category = get_object_or_404(Category, slug = category_slug)
products = products.filter(category=category)
return render(request,
'main/product/list.html',
{'category': category,
'categories': categories,
'producsts': products})
__________________________↑__________________________________
Ошибка была там, где я даже не предполагал