Create Session in Django | Login Session

Assuming you are created models & Login , Register html Template Go to URLS.PY path(‘login/’, views.login, name=’login’), path(‘register/’, views.register, name=’register’), path(‘index/’, views.index, name=’index’), path(‘logout/’, views.logout, name=’logout’), Go to VIEWS.PY def register(request): if request.method==’POST’: username=request.POST.get(‘username’) email = request.POST.get(’email’) password = request.POST.get(‘password’) user_list= models.administrator.objects.filter(username= username) error_name=[] if user_list: error_name=’The user name already exists’ return render (request, ‘register.html’,{‘error_name’: …

Create Session in Django | Login Session Read More »