Redirect Errot - Noreversematch: Reverse For 'edit' With Keyword Arguments '{'title': 'python'}' Not Found
I'm working on an app that allows the user to create, show and edit an entry. right now i'm working on the editing function. what i'm trying to do is have an edit button (that's ac
Solution 1:
Try adding a /
at the end of each url, like this:
urls.py
:
app_name = "wiki"
urlpatterns = [
path("", views.index, name="index"),
path("search/", views.search, name="search"),
path("new/", views.new, name="new"),
path("trans/", views.trans, name="trans"),
path("edit/", views.edit, name="edit"),
path("random/", views.rand, name="random"),
path("<str:title>/", views.title, name="title")
]
Also try using reverse and passing in the title as an arg on your views.py
:
return redirect(reverse('wiki:title', args=[title]))
Post a Comment for "Redirect Errot - Noreversematch: Reverse For 'edit' With Keyword Arguments '{'title': 'python'}' Not Found"