Django provide user authentication system to manage secure Login, Registration and Logout. Code of views.py from django.shortcuts import render,redirect from django.http import HttpResponse from . models import Register from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth import logout,login def reg ( request ): if request.method== 'POST' : user = User.objects.create_user(request.POST[ 'txtuser' ], request.POST[ 'txtemail' ],request.POST[ 'txtpass' ]) user.first_name=request.POST[ 'txtfirst' ] user.last_name=request.POST[ 'txtlast' ] user.save() return render(request, "helloapp/reg.html" , { "key" : "data inserted successfully" }) else : return render(reques...
Hi, I'm Shiva Gautam. With over 15 years of diverse experience in various IT domains, I am now an entrepreneur focusing on both training and software development. My expertise spans across multiple technologies, and I've authored numerous articles on subjects including Java, Python, REACT, NODE, ANGULAR, Cloud, software testing, Django framework, C#, Flutter, Salesforce, Ruby on Rails, .NET, and more. For additional information, please visit shivaconceptsolution.com and kangaroosoftware.net.