import authenticate, login, logout from django.contrib.auth.models import User def login_view(request): if request.method == 'POST': data = request.POST user = authenticate(username=data['username'], passwd=data['passwd']) if user is not None: login(request, user) return redirect('/') else: context_data = {'message': '아이디 또는 비밀번호를 확인해주세요!'} return render(request, 'login.html', context_data) else: return render(request, 'login.html') 44 / 85