[Answered ]-Reverse for '' not found. '' is not a valid view function or pattern name ERROR that i cannot see

1👍

The issue is with this line

<td><a href="{%  url '' item.id %}">Brought</a></td>

Add a valid URL name, like

<td><a href="{%  url 'item-detail' item.id %}">Brought</a></td>

0👍

I had same problem in the past and this is how I solved it:

  1. Add this to your app’s urls.py

    from django.urls import include, path
    
    from . import views
    
    app_name = "your_app_name"
    urlpatterns = [
        # Your patterns ...
    ]
    
  2. Now edit your base.html:

    <li class="nav-item">
        <a class="nav-link" href="{% url 'your_app_name:item-shoppinglist' %}">Shopping List</a>
    </li>
    

That should solve your problem

👤rgadzo

Leave a comment