Python, Django, Django Rest Framework, Backend, Programming.
import * class LoginView(APIView): permission_classes = [AllowAny] def post(self, request, *args, **kwargs): 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