Python, Django, Django Rest Framework, Backend, Programming.
== 0: otp_max_out = timezone.now() + datetime.timedelta(hours=1) elif max_otp_try == -1: user.max_otp_try = 3 else: user.otp_max_out = None user.max_otp_try = max_otp_try user.save() print(user.otp, 'OTP', user.phone) send_otp(user.phone, otp, user) return Response("Successfully generated OTP",