Python, Django, Django Rest Framework, Backend, Programming.
phone = request.data.get('phone') print(phone) try: user = User.objects.get(phone=phone) print(user) # Check for max OTP attempts if int(user.max_otp_try) == 0 and user.otp_max_out and timezone.now() < user.otp_max_out: return Response( "Max OTP try reached, try after an hour",