“object of type 'NoneType' has no len()” error
问题 Error: object of type 'NoneType' has no len() Error in Signupform validation in django def signup(request): print(request) if request.method == "POST": error_msg = None fname = request.POST.get('fname') lname = request.POST.get('lname') email = request.POST.get('email') password = request.POST.get('password') value = {'fname': fname, 'lname': lname, 'email':email} customer = Signup(first_name=fname, last_name=lname, email=email, password=password) if len(fname) < 4: error_msg = "First Name