[Answered ]-Django NoReverseMatch error โ€“ urls.py path appears to match

1๐Ÿ‘

โœ…

I deleted my previous answer, my apologies. You should make your life easy and restructure your url

path('wiki/edit/<str:entry>', views.edit, name="edit")

<button href="{% url 'edit' entry=entryTitle %}"></button>

This should work.

The previous way was:

path('wiki/<str:entry>/edit', views.edit, name="edit')

I get the error message:

Reverse for 'edit' with keyword arguments '{'entry': ''}' not found. 1 pattern(s) tried: ['so/wiki/(?P<entry>[^/]+)/edit$']

Iโ€™m not sure why, but its something to do with it being an object, because passing in a hardcoded string "maggie" instead of entryTitle works fine. Sorry for all the confusion.

๐Ÿ‘คsin tribu

Leave a comment