Answers for "signup class"

0

signup class

class SignUpView(generic.CreateView):
    form_class 			= UserCreationForm
    success_url 		= reverse_lazy('login')
    template_name		= 'registration/signup.html'
    
    def form_valid(self, form):
        view        = super(SignUp, self).form_valid(form)
        username    = form.cleaned_data.get('username')
        password    = form.cleaned_data.get('password1')
        user        = authenticate(username=username, password=password)       
        login(self.request, user)
        return view
Posted by: Guest on September-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language