Unexpected NoReverseMatch error when using include() in urls patterns

This indicates the problem.

'$(?P<pk>[0-9]+)/$'

There shouldn’t be a dollar sign (which matches the end of the string) at the beginning of the pattern.

The problem is caused by the way you are including the urls.py. You currently have a dollar in the regex:

url(r'^$', include('feature.urls', namespace="feature")),

To fix the problem, remove the dollar from the regex.

url(r'^', include('feature.urls', namespace="feature")),

Leave a Comment