django-sms

A Django app for sending SMS with interchangable backends
Download

django-sms Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Niels Sandholt Busch
  • Publisher web site:

django-sms Tags


django-sms Description

django-sms is a Django app for sending SMS with interchangable backends.Backends- 'sms.backends.dummy.SMSBackend'- 'sms.backends.locmem.SMSBackend'- 'sms.backends.console.SMSBackend'Writing a custom backendYou can write your own SMS backend by subclassing BaseSMSBackend and overriding the send_sms method. On any error, your backend should raise SMSErrorclass SMSBackend(BaseSMSBackend): """ My custom sms backend """ def __init__(self): self.client = MyClient(settings.KEY, settings.SECRET) def send_sms(self, message, from_, to): if not self.client.send_message(message, from_, to): raise SMSErrorUsage1. Add an SMS backend to SMS_BACKEND in settings.py. SMS_BACKEND = 'sms.backends.console.SMSBackend'2. call send_sms from sms import send_sms send_sms(text, from_, to)Testingsms.original_sms_backend = settings.SMS_BACKENDsettings.SMS_BACKEND = 'sms.backends.locmem.SMSBackend'sms.outbox = []sms.send_sms('my message', 'me', 'you')self.assertIn('message', sms.outbox)Product's homepage


django-sms Related Software