Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to insert the group_id of a user to 'auth_user_groups' table
- details = User(username = "somename",password = "somepassword", email = "email",
- first_name = "firstname",
- last_name = "lastname",
- is_staff = 0,
- is_active = 1,
- is_superuser = 0
- )
- details.save()
- save = auth_user_groups(user_id=1,group_id = 5)
- user = User.objects.get(id=1)
- group = Group.objects.get(id=5)
- user.groups.add(group)
Add Comment
Please, Sign In to add comment