from django.db.models import Count ModelName.objects.aggregate(Count('id'))
please check the ref for more