Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.9 kB
1
Indexable
Never
def base1(request):
    return HttpResponse("used to print response in application url")
def base2(request):
    return HttpResponse("hello")
def logins(request):
    return render(request,"login.html")
def login_post(request):
    username=request.POST['username']
    password=request.POST['password']
    lobj=login()
    lobj.username=username
    lobj.password=password
    lobj.save()
    return HttpResponse('success')
def view_login(request):
    lobj = login()
    result=login.objects.all()
    return render(request, "login.html", {'data':result})
def reg(request):
    return render(request,"register.html")

def register_view(request):
    return render(request,"view.html", )

def reg_post(request):
    name=request.POST['name']
    email=request.POST['email']
    phone=request.POST['phone']
    gender=request.POST['gender']
    district=request.POST['district']
    password=request.POST['password']
    confirm_password=request.POST['confirm password']
    robj=registration()
    robj.name=name
    robj.email=email
    robj.phone=phone
    robj.gender=gender
    robj.district=district
    robj.password=password
    robj.save()
    return HttpResponse("successfull"),
def edit_reg(request, id):
    result=registration.objects.get(id=id)
    return render(request,"edit.html")
def editpost(request):
    id=request.POST['id']
    name = request.POST['name']
    email = request.POST['email']
    phone = request.POST['phone']
    gender = request.POST['gender']
    district = request.POST['district']
    password = request.POST['password']
    confirm_password = request.POST['confirm password']
    robj = registration()
    robj.name = name
    robj.email = email
    robj.phone = phone
    robj.gender = gender
    robj.district = district
    robj.password = password
    robj.save()
    return HttpResponse("successfull"),