继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

python为啥标题要这么长?

小杜嘟嘟
关注TA
已关注
手记 1
粉丝 3
获赞 2

<pre>
def login(request):
if request.method == "GET":
return render(request, 'login.html')
elif request.method == "POST":
username = request.POST.get('username','')
password = request.POST.get('password','')
print username, password

models.UserInfo.objects.create(user=username, password=password)
    result = models.UserInfo.objects.filter(user=username,password=password)
    resulta = models.UserInfo.objects.filter(user=username,password=password).first()
    if result:
        print result
        print resulta
    else:
        return HttpResponse('用户名或密码错误')
return render(request, 'index.html', {'result': result})</pre>
打开App,阅读手记
2人推荐
发表评论
随时随地看视频慕课网APP

热门评论

def login(request):
    if request.method == "GET":
        return render(request, 'login.html')
    elif request.method == "POST":
        username = request.POST.get('username','')
        password = request.POST.get('password','')
        print username, password
        # models.UserInfo.objects.create(user=username, password=password)
        result = models.UserInfo.objects.filter(user=username,password=password)
        resulta = models.UserInfo.objects.filter(user=username,password=password).first()
        if result:
            print result
            print resulta
        else:
            return HttpResponse('用户名或密码错误')
    return render(request, 'index.html', {'result': result})


查看全部评论