[Answered ]-How to count users posts in Django?

2👍

Do you not want to use the built in count, because that would solve your problem.

views.py- should get all the users, if you wanted a selected user group per se you would just use filter

 context = {}
 post_numbers =  Post.objects.all().count()
 context['post_numbers'] = post_numbers

Template

  {{ post_numbers }}

Leave a comment