[Django]-The current path,didn't match any of these

1👍

I replace the URL path

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

2👍

The B0882NKXW7 is not a valid format for a UUID [wiki]. Indeed, a UUID is typically represented as 16 octets. For example 2707820f-5182-407d-9c07-ff7845807d4c is a UUID.

You can either define your own path converter [Django-doc] to accept your product id, or you can make use of str::

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

Leave a comment