اولین کامیت پروژه پایاچت
This commit is contained in:
2026-11-05 16:45:16 +03:30
commit 46ff71a260
65 changed files with 4820 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import requests
from django.conf import settings
def send_sms_otp(mobile, code):
url = "https://s.api.ir/api/sw1/SmsOTP"
headers = {
"Authorization": f"Bearer {settings.API_TOKEN_OTP_SMS}",
"Content-Type": "application/json"
}
data = {
"code": code,
"mobile": mobile,
"template": 2
}
try:
response = requests.post(url, json=data, headers=headers, timeout=10)
if response.status_code == 200:
result = response.json()
return bool(result.get("success"))
return False
except requests.exceptions.RequestException:
return False