i follow you not work again first i cant use {% url %} show me template error,i thing so i am is very noob must necesery tu urls for that ? Τη Τρίτη, 19 Ιανουαρίου 2016 - 5:35:09 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i want to create a query for likes in my post details > > my html tags > > <p>{{movies.likes}} peaple liked this article</p> > <p><a href="/like/{{post.id}}">Like</a></p> > > > my urls > > > url(r'^view/(?P<slug>[^\.]+)/$', views.view_post, name='view_post'), > > url(r'^(?P<pk>[0−9]+)/$', views.like_post, name='like_post'), > > > my view > > > def like_post(request,pk=1): > a=Movies.objects.get(pk=pk) > count=a.likes > count+=1 > a.likes=count > a.save() > return HttpResponseRedirect ( '/posts/view/%s' % pk) > > > but i have error not work > > > Page not found (404)Request Method:GETRequest > URL:http://127.0.0.1:8000/like/1/ > > Using the URLconf defined in categories1.urls, Django tried these URL > patterns, in this order: > > 1. ^admin/ > 2. ^$ [name='index'] > 3. ^view/(?P<slug>[^\.]+)/$[name='view_post'] > 4. ^category/(?P<slug>[\w-]+)/$[name='view_category'] > > 5. ^(?P<pk>[0−9]+)/$ [name='like_post'] > 6. ^media\/(?P<path>.*)$ > > The current URL, like/1/, didn't match any of these. > > > > any idea ? > >
-- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/24bb10c8-98a2-445d-8de2-5abf0f5a618e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.