django add user to group
from django.contrib.auth.models import Group, User
g = Group.objects.get(name='My Group Name')
users = User.objects.all()
for u in users:
g.user_set.add(u)
django add user to group
from django.contrib.auth.models import Group, User
g = Group.objects.get(name='My Group Name')
users = User.objects.all()
for u in users:
g.user_set.add(u)
django add user to group
from django.contrib.auth.models import Group, User
tonystark=User.objects.get(id=pk)
hulk=Group.objects.get(name='groupname')
hulk.user_set.add(tonystark)
django add user to group
from django.contrib.auth.models import Group
my_group = Group.objects.get(name='my_group_name')
my_group.user_set.add(your_user)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us