Reverse for 'car_details' with arguments '('',)' not found. 1 pattern(s) tried:

44 views
Skip to first unread message

Bipul Dawadi

unread,
Jan 21, 2023, 5:01:55 PM1/21/23
to Django developers (Contributions to Django itself)
  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  

Tim Graham

unread,
Jan 22, 2023, 2:55:58 PM1/22/23
to Django developers (Contributions to Django itself)
Hi, You've found the wrong mailing list for this post. This mailing list is for discussing the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it.

For support, please follow the "Getting Help" page: https://docs.djangoproject.com/en/stable/faq/help/ . This will help you find people who are willing to support you, and to ask your question in a way that makes it easy for them to answer.

Did the place you found this mailing list make this unclear?
Reply all
Reply to author
Forward
0 new messages