1👍
✅
What you need is:
category_posts = category.posts_set.all()
or
category_posts = Posts.objects.filter(category=category)
I encourage you to read Django tutorial.
Source:stackexchange.com