I created a custom group in Django's admin site.
In my code, I want to check if a user is in this group. How do I do that?
You can access the groups simply through the
groups attribute on
from django.contrib.auth.models import User, Group group = Group(name="Editor") group.save() # save this new group for this example user = User.objects.get(pk=1) # assuming, there is one initial user user.groups.add(group) # user is now in the "Editor" group