A simple Django app to send SMS messages using an API similar to that of django.core.mail.
Project description
django-smsish
Forked from RyanBalfanz
Installation
Add smsish
to your INSTALLED_APPS
and set SMS_BACKEND
.
INSTALLED_APPS += (
'smsish',
)
SMS_BACKEND_CONSOLE = 'smsish.sms.backends.console.SMSBackend'
SMS_BACKEND_DUMMY = 'smsish.sms.backends.dummy.SMSBackend'
SMS_BACKEND_TWILIO = 'smsish.sms.backends.twilio.SMSBackend'
SMS_BACKEND_YUNPIAN = 'smsish.sms.backends.yunpian.SMSBackend'
SMS_BACKEND = SMS_BACKEND_DUMMY
Twillio
To use the Twilio backend set some additional settings as well.
TWILIO_ACCOUNT_SID = os.getenv("TWILIO_ACCOUNT_SID", None)
TWILIO_AUTH_TOKEN = os.getenv("TWILIO_AUTH_TOKEN", None)
TWILIO_MAGIC_FROM_NUMBER = "+15005550006" # This number passes all validation.
TWILIO_FROM_NUMBER = os.getenv("TWILIO_FROM_NUMBER", TWILIO_MAGIC_FROM_NUMBER)
Example:
from smsish.sms import send_sms
send_msg(message, '', (phone,))
Note: You must also pip install twilio
to use the Twilio backend.
Yunpian
settings.py:
YUNPIAN_API_KEY = getenv("YUNPIAN_API_KEY")
Note: You must also pip install yunpian-python-sdk
to use the YunPian backend.
Example:
from smsish.sms import send_sms
send_msg(message, '', (phone,))
Test
tox
# tox in docker
docker run --rm -it -v ${PWD}:/src themattrix/tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-smsish2-1.3.5.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for django_smsish2-1.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 074d58f216b4f7054873efca980a2ec475a793bfa919ab2daf9bf52eadd30020 |
|
MD5 | 6b4609d19ff5a1e5836144ee96be71ef |
|
BLAKE2b-256 | c7cd2ff4c91895a05b169a8698035210f9a66b4090bb907f2402651748d2d62c |