from django.contrib.auth.models import User def some_view(request): user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword') # if you want to change other fields. user.last_name = 'Lennon' user.save()
ref:-https://docs.djangoproject.com/en/1.5/topics/auth/default/#creating-users