in app have 3 kind of users different permissions. hr, employees , candidate.
i able create user employee providing email ans set inactive , when employee sign in app setup first name, last name , password , become active on app
i starting in django , have no idea how it;
i started authentication process using documentation , :
views.py :
from django.shortcuts import render .forms import hrform, candidateform, employeeform django.core.urlresolvers import reverse django.contrib.auth.decorators import login_required django.http import httpresponse, httpresponseredirect django.contrib.auth import authenticate,login,logout django.contrib.auth.backends import modelbackend .models import myuser def registeremployee(request): registered = false if request.method == "post": employee_form = employeeform(data=request.post) if employee_form.is_valid(): user = employee_form.save() user.set_password(user.password) user.is_employee = true user.save() registered = true else: print("error!") else: employee_form = employeeform() return render(request,'employee_registration_form.html', {'employee_form':employee_form, 'registered':registered})
could please me or give me direction dive in ? thx ;)
Comments
Post a Comment