code: def verify_otp(request):
      
      ctx = {}
  
      if request.method == "POST":
          verification_code = request.POST.get('verification_code')
  
          if verification_code is None:
              ctx['error_message'] = "Missing verification code."
          else:
              otp_ = UserOTP.objects.get(user=request.user)
              totp_ = totp.TOTP(otp_.secret_key)
  
              is_verified = totp_.verify(verification_code)
  
              if is_verified:
                  request.session['verfied_otp'] = True
                  response = redirect(request.POST.get("next", settings.LOGIN_REDIRECT_URL))
                  return update_rmb_cookie(request, response)
              ctx['error_message'] = "Your code is expired or invalid."
  
      ctx['next'] = request.GET.get('next', settings.LOGIN_REDIRECT_URL)
      return render(request, 'django_mfa/login_verify.html', ctx, status=400)
docs: Verify a OTP request