A Python library for sending SMS via the Sayqal.uz SMS gateway. This library allows you to send SMS messages from your Django application easily.
Install the package via pip:
pip install smsuz-
Add the
smsapplication to your Django project's installed apps. Open yoursettings.pyfile and update as follows:INSTALLED_APPS = [ ... 'sms', ]
-
Add the
SAYQAL_USERNAMEandSAYQAL_SECRETKEYconstants to your project settings, which you can obtain after registering on Sayqal.uz:# settings.py SAYQAL_USERNAME = 'your_username_here' SAYQAL_SECRETKEY = 'your_secretkey_here'
-
Run the database migrations to apply any necessary changes:
python manage.py migrate
Import the sendSms function and use it to send SMS messages:
from sms.utils import sendSms
# Example of sending an SMS
sendSms('+998971234567', 'Your SMS message text')from sms.utils import sendSms
# Send an SMS to the specified phone number
phone_number = '+998971234567'
message = 'Your confirmation code: 123456'
sendSms(phone_number, message)This project is licensed under the MIT License. See the LICENSE file for details.
by AbexLab