记录
# def mylogin(request):
# if request.method == 'POST': # 当提交表单时
# form = LoginForm(request.POST) # form 包含提交的数据
# if form.is_valid(): # 如果提交的数据合法
# name = form.cleaned_data['name']
# pwd = form.cleaned_data['pwd']
# users = Users.objects.filter(user_name=name)[0].pwd
# if users == pwd:
# return HttpResponseRedirect('/homepage/') #跳转到主页
# else: # 当正常访问时
# form = LoginForm()
# return render(request, 'app/login.html', {'form': form})form