Skip to main content

django-sms

A Django app for sending SMS with interchangable backends.

Requirements

Required

  • Python 2.5+

  • Django 1.2+

Backends

  • ‘sms.backends.dummy.SMSBackend’

  • ‘sms.backends.locmem.SMSBackend’

  • ‘sms.backends.console.SMSBackend’

Writing a custom backend

You can write your own SMS backend by subclassing BaseSMSBackend and overriding the send_sms method.

class SMSBackend(BaseSMSBackend):
    """
    My custom sms backend

    """
    def __init__(self):
        self.client = MyClient(settings.KEY, settings.SECRET)

    def send_sms(self, message, from_, to):
        self.client.send_message(message, from_, to)

Usage

  1. Add an SMS backend to SMS_BACKEND in settings.py.

SMS_BACKEND = 'sms.backends.console.SMSBackend'
  1. call send_sms

from sms import send_sms

send_sms(text, from_, to)

Testing

sms.original_sms_backend = settings.SMS_BACKEND
settings.SMS_BACKEND = 'sms.backends.locmem.SMSBackend'
sms.outbox = []

sms.send_sms('my message', 'me', 'you')
self.assertIn('message', sms.outbox[0]['text'])

Metadata

Release files for django-sms 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sms 0.0.2
File Size Uploaded Provenance Actions
django-sms-0.0.2.tar.gz 2.4 kB Without provenance Details for django-sms-0.0.2.tar.gz

Release files / django-sms-0.0.2.tar.gz

Download URL django-sms-0.0.2.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c74d32a3f191eeeb92e3976fb2f143c07542b31c8169365d9724771b13996232
BLAKE2b-256 checksum
How to use checksums
dbadd61bfbe2d1a763ba71b421f096064941554deeaa732fe42156e33e0f732d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-sms 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page