from django.contrib.auth.models import User user = User.objects.get(pk=5) user.set_password('super-sekrit') user.save()