1👍
In django, filter(tags=tag)
is a shortcut to tags__pk=tag
, in your case, you have a tag name, so you should use filter(tags__name=tag)
0👍
Update following line in your tadgetails
view
posts = Post.objects.filter(tags=tag)
as
posts = Post.objects.filter(tags__name=tag)
- [Answer]-How to assign a value to a variable in the template?
- [Answer]-Django: Initial modelform fields with the same name
- [Answer]-Make a div-row collapse in html/css/django
- [Answer]-Django API tastypie and FK POST
- [Answer]-Backbone.js appending [] to key name on fetch
Source:stackexchange.com