1π
β
It will never access watchlist
, since the <str:listing_title>
will match for /watchlist
. You should reorder the paths, and work with:
path('', views.index, name='index'),
path('watchlist', views.watchlist, name='watchlist'),
path('<str:listing_title>', views.listing, name='listing'),
Django will enumerate over all the URL patterns top-to-bottom, and "fire" the first view that has a matching URL pattern. If we thus put <str:listing_title>
first, it will match watchlist
with that <str:β¦>
path part, and thus never trigger the listing
.
Source:stackexchange.com