'Create and immediately log in a new user.'

def register(self, request, form=None, **kwargs):

    (username, email, password) = (kwargs['username'], kwargs['email'], kwargs['password1'])
    new_user = get_user_model().objects.create_user(username, email, password)
    signals.user_registered.send(sender=self.__class__, user=new_user, request=request)
    authenticated_user = self.authenticate(request, username, password)
    return authenticated_user
