1from django.contrib.auth.models import Group, User
2
3g = Group.objects.get(name='My Group Name')
4users = User.objects.all()
5for u in users:
6 g.user_set.add(u)
1from django.contrib.auth.models import Group, User
2tonystark=User.objects.get(id=pk)
3hulk=Group.objects.get(name='groupname')
4hulk.user_set.add(tonystark)
1from django.contrib.auth.models import Group
2my_group = Group.objects.get(name='my_group_name')
3my_group.user_set.add(your_user)