Search code examples
djangodjango-viewsdjango-templatesdjango-urlsdjango-url-reverse

The current path,didn't match any of these


I have this in urls.py

urlpatterns = [
path("product/<str:title>/<slug:pname>/<uuid:puid>",views.viewProduct),
]

But when I try to click on the url. I got this error.

The current path, product/amazon/home-secure-snake-shield-natural-snake-r/B0882NKXW7, didn't match any of these.

Here I just want the puid but to match the pattern of URL I added str:title and str:pname

I don't want the title and pname. But my URL patern is like this-

product/store_name/product_name_slug/product_id

Solution

  • I replace the URL path

    urlpatterns = [
    path("product/<str:title>/<slug:pname>/<str:puid>",views.viewProduct),
    ]