When i clicked my menu url only gets category name and slug cant reach id how can i solve that ?
def category_products (request,id,slug):
category=Category.objects.all()
products=Product.objects.filter(category_id=id)
context={'products':products,'category':category,'slug':slug, }
return render(request, 'kiliclar.html', context)
urlpatterns = [
path('category/<int:id>/<slug:slug>/', views.category_products,name='category_products'),
]
template
{% recursetree category %}
<li class="dropdown">
<a href="/category/{{ node.slug }}" class="nav-link dropdown-toggle arrow" data-toggle="dropdown">{{ node.title }}</a>
{% if not node.is_leaf_node %}
<ul class="dropdown-menu">
<li><a href="#">{{ children }}</a></li>
</ul>
{% endif %}