1python manage.py shell
2
3from django.contrib.auth.models import User
4
5usr = User.objects.get(username='your username')
6usr.set_password('raw password')
7usr.save()
1myuser.groups.set([group_list])
2myuser.groups.add(group, group, ...)
3myuser.groups.remove(group, group, ...)
4myuser.groups.clear()
5myuser.user_permissions.set([permission_list])
6myuser.user_permissions.add(permission, permission, ...)
7myuser.user_permissions.remove(permission, permission, ...)
8myuser.user_permissions.clear()
9