Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
885 B
1
Indexable
from django.http import HttpResponse
from django.shortcuts import render

# Create your views here.
def login(request):
    return render(request,"login.html")

def login_post(request):
    username=request.POST['username']
    password=request.POST['password']
    return HttpResponse('''<script>alert('login successfully');windows.location="/myapp/login/"</scipt>''')

def reg(request):
    return render(request,"reg.html")

def reg_post(request):
    name=request.POST['Name']
    email=request.POST['email']
    phone=request.POST['Phone']
    photo=request.POST['Photo']
    gender=request.POST['gender']
    district=request.POST['District']
    password=request.POST['Password']
    confirm_password=request.POST['Confirm password']
    return HttpResponse('''<script>alert('Registration successfully');windows.location="/myapp/reg/"</scipt>''')