Sunday, September 27, 2015

NoReverseMatch error in django 1.8

this is my views and
as long as use <a> tag in my template show error


urlpatterns = [      url(r'^bookee/$', views.index, name='index'),      url(r'^bookee/user/(?P<user>[a-z0-9-._@+]\w+)/$', views.uprofile, name='userprofile'),      url(r'^bookee/user/(?P<user>[a-z0-9-._@+]\w+)/book/(?P<bookid>\d)/$', views.bookprof, name='bookp'),      url(r'^bookee/user/(?P<user>[a-z0-9-._@+]\w+)/publisher/(?P<publishid>\d)/$', views.publishprof, name='publishep'),    ]



def uprofile(request, user):      usr = User.objects.get(username=user)      book = Book.objects.filter(user=usr)      return render(request, 'u/uprof.html', {'usr': usr, 'book': book})      def bookprof(request, user, bookid):      usr = User.objects.get(username=user)      bookid = Book.objects.get(id=bookid)      # bookd = Book.objects.filter(id=bookid)      return render(request, 'u/uprof.html', {'usr':usr,'bookid': bookid})      def publishprof(request, user, publishid):      usr = User.objects.get(username=user)      pubid = Publisher.objects.get(id=publishid)      publisher = Publisher.objects.filter(id=pubid)      return render(request, 'u/uprof.html', {'usr':usr,'publisher': publisher})


    <a href="{% url 'bookp' %}">          <p>          list of books      </p>          </a>
NoReverseMatch at /bookee/user/admin/    Reverse for 'bookp' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['bookee/user/(?P<user>[a-z0-9-._@+]\\w+)/book/(?P<bookid>\\d)/$']

thanks for your help

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment