Python, Django, Django Rest Framework, Backend, Programming.
status=status.HTTP_200_OK) except ObjectDoesNotExist: user_ = User.objects.create(phone=phone) print(user_) otp = random.randint(1000, 9999) otp_expiry = timezone.now() + datetime.timedelta(minutes=10) max_otp_try = int(user_.max_otp_try) - 1 user_.otp = otp user_.otp_expiry = otp_expiry