Blueherb In solitude, where we are least alone

寒假自学1.24

中文无法解析 
message =u '你搜索的内容为: ' + request.GET['q']
https://www.runoob.com/django/django-auth.html
def login(request):
    if request.method == "GET":
        return render(request, "login.html")
    username = request.POST.get("username")
    password = request.POST.get("pwd")
    valid_num = request.POST.get("valid_num")
    keep_str = request.session.get("keep_str")
    if keep_str.upper() == valid_num.upper():
        user_obj = auth.authenticate(username=username, password=password)
        print(user_obj.username)

 

 
posted @ 2021-01-24 01:01  帅气的小土豆  阅读(8)  评论(0编辑  收藏  举报