In Views.py
def car_details(request, id):
redirect_to=1
single_car = get_object_or_404(Car, pk=id),
data = {
'single_car': single_car,
# 'url': url,
}
# reverse('single_car', args=(id))
return render(request, 'cars/car_details.html', data)
In urls.py of my app
urlpatterns = [
path('', views.cars, name='cars'),
path('\<int:id\>/car_details', views.car_details, name='car_details'),]
and In my templates cars.html
{% for car in cars %} <h1>
<a href="{% url ">{{car.car_title}}</a>
</h1>
<a href="{% url ">
{{car.state}}, {{car.city}}
</a>
{% endfor %}
when i tried to call this car_details.html with urls function it show me this error
Reverse for 'car_details' with arguments '('',)' not found. 1 pattern(s) tried:
I also tried with reverse function it doesnot work,How can I solve this error