How would I add a user to a group in django by the group\'s name?
I can do this:
user.groups.add(1) # add by id
How would I do some
Find the group using Group model with the name of the group, then add the user to the user_set
from django.contrib.auth.models import Group my_group = Group.objects.get(name='my_group_name') my_group.user_set.add(your_user)