from django.contrib.auth.models import User, Permission
from django.db.models import Q
perm = Permission.objects.get(codename='blogger')
How to get a list of all users with a specific permission group in Django