Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: fonts in python 
Python :: call class function by string python 
Python :: print f python 
Python :: print 
Python :: ord() python 
Python :: python 3 docs 
Python :: python read file between two strings 
Python :: plot the distribution of value_counts() python 
Python :: python global lists 
Python :: python utf upper() 
Python :: python % meaning 
Python :: string to list 
Python :: update matplotlib params 
Python :: pandas data frame from part of excel 
Python :: numpy concatenate arrays 
Python :: Python get the name of the song that is playing 
Python :: argparse parse path 
Python :: odoo docker addons path 
Python :: How to take multiple inputs in one line in python using list comprehension 
Python :: matplotlib yaxis off 
Python :: Iterate through string in python using for loop 
Python :: convert plt.show to image to show opencv 
Python :: python add new key to dictionary 
Python :: any() and all() 
Python :: numpy if zero is present 
Python :: python counting up and down 
Python :: python pathlib os module 
Python :: access cmd with python 
Python :: how to open py file without console 
Python :: python game github 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =