Django how to remove a user from a group
See documentation https://docs.djangoproject.com/en/stable/topics/auth/#methods
g.user_set.remove(your_user)
The simplest method to clear all user groups from the user object is
user_obj.groups.clear()
To remove a specific Group:
group = Group.objects.get(name='groupname')
user.groups.remove(group)