Reverse for 'car_details' with keyword arguments '{'id': ''}' not found. 1 pattern(s) tried: ['cars(?P<id>[0-9]+)/car_details\\Z']

In urlpatterns = [ path('',, name='cars'),
path('int:id/car_details', views.car_details, name='car_details'), ] In def car_details(request, id): single_car = get_object_or_404(Car, pk=id), id = 1 data = { 'single_car': single_car, # 'url': url, } reverse('single_car', args=(id))

return render(request, 'cars/car_details.html', data) In templates { %for car in cars %}

{{car.car_title}} {{car.state}}, {{}}

endfor %} I also tried with reverse function it doesnot works get an same error

tried with reverse function in it doesnot works get an same error

Back to Top