예제 #1
0
def login(request):
    if request.method == 'POST':
        user = request.POST.get('user')
        pwd = request.POST.get('pwd')
        if user == 'alex' and pwd == '123':
            return redirect(to='/index/')
    return render(request, 'login.html')
예제 #2
0
def index(request):
    return render(request, 'index.html')
예제 #3
0
 def post(self, request):
     user = request.POST.get('user')
     pwd = request.POST.get('pwd')
     if user == 'alex' and pwd == '123':
         return redirect(to='/index/')
     return render(request, 'login.html')
예제 #4
0
 def get(self, request, *args, **kwargs):
     return render(request, 'login.html')
예제 #5
0
def reg(request):
    if request.method == 'POST':
        user = request.POST.get('user')
        pwd = request.POST.get('pwd')
        return redirect(to='/login/')
    return render(request, 'reg.html')