最佳答案
如何通过组名将用户添加到 django 中的组?
我能做到:
user.groups.add(1) # add by id
我怎么会做这种事:
user.groups.add(name='groupname') # add by name