src/jycampus/apps/userbase/views.py
def post(self, request):
        """
        function which handles post request from login and signup form
        to login and create user
        :param request:
        :param args:
        :param kwargs:
        :return:
        """

        login_form = self.login_form(request.POST)
        context = {
            'login_form': login_form,

        }
        if login_form.is_valid():
            email = login_form.cleaned_data.get('email')
            raw_password = login_form.cleaned_data.get('password')
            try:
                user = authenticate(email=email, password=raw_password)
                print(user)
                login(request, user)
                return redirect('/user/home')
            except:
                messages.warning(request, 'Email And Password Does Not Match.')
                return redirect('/user/login')
        return render(request, self.template_name, context)

        function which handles post request from login and signup form
        to login and create user
        :param request:
        :param args:
        :param kwargs:
        :return:
        
function which handles post request from login and signup form
to login and create user
function which handles post request from login and signup form to login and create user
def post(self, request):
        login_form = self.login_form(request.POST)
        context = {
            'login_form': login_form,
        }
        if login_form.is_valid():
            email = login_form.cleaned_data.get('email')
            raw_password = login_form.cleaned_data.get('password')
            try:
                user = authenticate(email=email, password=raw_password)
                print(user)
                login(request, user)
                return redirect('/user/home')
            except:
                messages.warning(request, 'Email And Password Does Not Match.')
                return redirect('/user/login')
        return render(request, self.template_name, context)
def post ( self , request ) : login_form = self . login_form ( request . POST ) context = { 'login_form' : login_form , } if login_form . is_valid ( ) : email = login_form . cleaned_data . get ( 'email' ) raw_password = login_form . cleaned_data . get ( 'password' ) try : user = authenticate ( email = email , password = raw_password ) print ( user ) login ( request , user ) return redirect ( '/user/home' ) except : messages . warning ( request , 'Email And Password Does Not Match.' ) return redirect ( '/user/login' ) return render ( request , self . template_name , context )
function which handles post request from login and signup form
to login and create user
function which handles post request from login and signup form to login and create user
"""
        function which handles post request from login and signup form
        to login and create user
        :param request:
        :param args:
        :param kwargs:
        :return:
        """
None
self
request
None
args
None
kwargs
None