寒假自学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)