[Answered ]-Django: unable to login with new users

2👍

You should transform your UserProfileCreate class with the following :

class UserProfileCreate(CreateView):
    model = UserProfile
    form_class = UserProfileForm
    queryset = UserProfile.objects.all()
    success_url = '/sites/list'
    def form_valid(self, form):
        self.object = form.save()
        self.object.set_password(self.object.password)
        return super(UserProfileCreate, self).form_valid(form)

It will hash the user password.

Leave a comment