Skip to content

Send SMS messages in Django just like you send email messages

License

Notifications You must be signed in to change notification settings

o3o3o/django-smsish

 
 

Repository files navigation

PyPI version Build Status

django-smsish2

Forked from RyanBalfanz

Installation

pip install django-smsish2

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

About

Send SMS messages in Django just like you send email messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Makefile 0.9%