Django Dynamic URL Not Working

I am configuring a dynamic url in my django project. I have followed the instructions provided on the net but it is not working.

urls.py in app

urlpatterns = [
    url(r'^seci/<int:secn>', views.sect, name = 'sect'),
    url('sections/<str:secn>/', views.sections, name = 'sections'),
]

views.py in app

def sect(request,secn):
    print("secn:", secn)
    return HttpResponse("testing")


def sections(request, secn):
    print("secn:", secn)
    return HttpResponse(secn)

Django says, url not found. I don’t know what else to do.

Worked using url(r’sections/(?P\w+)/’, views.sections, name = ‘sections’),

The “new style” url reference (using the path component specifiers such as <str:secn>), are used with the path function, not the url function. See the Examples in the URLs docs.