• Stars
    star
    249
  • Rank 162,987 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 13 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple API to send SMS messages. It is modeled after the django email api.

django-sendsms

https://coveralls.io/repos/github/stefanfoulis/django-sendsms/badge.svg?branch=master https://github.com/stefanfoulis/django-sendsms/workflows/Django%20Send%20SMS%20Build/badge.svg?branch=master

A simple api to send SMS messages with django. The api is structured the same way as Django's own email api.

Installation

pip install django-sendsms

Configure the SENDSMS_BACKEND (defaults to 'sendsms.backends.console.SmsBackend'):

SENDSMS_BACKEND = 'myapp.mysmsbackend.SmsBackend'

Basic usage

Sending SMSs is like sending emails:

from sendsms import api
api.send_sms(body='I can haz txt', from_phone='+41791111111', to=['+41791234567'])

You can also make instances of SmsMessage:

from sendsms.message import SmsMessage
message = SmsMessage(body='lolcats make me hungry', from_phone='+41791111111', to=['+41791234567'])
message.send()

Custom backends

Creating custom SmsBackend s:

from sendsms.backends.base import BaseSmsBackend
import some.sms.delivery.api

class AwesomeSmsBackend(BaseSmsBackend):
    def send_messages(self, messages):
        for message in messages:
            for to in message.to:
                try:
                    some.sms.delivery.api.send(
                        message=message.body,
                        from_phone=message.from_phone,
                        to_phone=to,
                        flashing=message.flash
                    )
                except:
                    if not self.fail_silently:
                        raise

Then all you need to do is reference your backend in the SENDSMS_BACKEND setting.

Running tests

python setup.py test

Or better, install and run "tox".

Contributing

Pull requests are very welcome. Please make sure code is formatted using black and isort.

More Repositories

1

django-phonenumber-field

A django model and form field for normalised phone numbers using python-phonenumbers
Python
1,483
star
2

django-class-based-auth-views

Python
81
star
3

django-image-filer

Image Management Application for django. For the most current version please check out django-filer.
Python
45
star
4

django-database-email-backend

A django email backend that delivers mails to the database for development.
Python
23
star
5

django-graceful-session-cleanup

A simple management command that can delete expired sessions from large session tables without killing the site.
Python
16
star
6

python-ardroneapi

A standalone pure python api to control the AR.Drone. EXPERIMENTAL and mostly untested!
Python
9
star
7

vagrant-django-playground

Just playing around with vagrant to make a virtual django deployment
8
star
8

django-notifyme

A notification framework for django apps. (STILL VERY ALPHA)
Python
8
star
9

gitosis

a fork of git://eagain.net/gitosis.git
Python
6
star
10

django-project-scaffolding

An attempt to find the most awesome standardized django project layout that works well with local development and deployment on servers.
Python
5
star
11

djangocms-oscar

A minimal example app to demonstrate how to integrate oscar.
Python
5
star
12

django-sendsms-admin

A database delivery backend for django-sendsms (for debugging).
Python
4
star
13

django-smart-slug

A smart slug field for your models
Python
4
star
14

django-widgetry

[EXPERIMENTAL and BROKEN] a collection of widgets for the admin
JavaScript
4
star
15

django-notifyme-by-email

A email delivery backend for django-notifyme
Python
4
star
16

djangorecipe

non official version of djangorecipe
Python
3
star
17

opbeat-datadog-hook

a hook to connect opbeat to datadog
Python
3
star
18

django-notifyme-onsite

A on site delivery backend for django-notifyme
Python
3
star
19

djangoprojectrecipe

A simplified version of djangorecipe
Python
3
star
20

django-picnic

A django app that makes team project management a picnic (nothing here yet)
3
star
21

moviepy-timelapse-experiment

Python
2
star
22

packageindex-project

A django project using django-packageindex to provide a pypi mirror
Python
2
star
23

django-packageindex

A smart pypi mirror. [HIGHLY EXPERIMENTAL]
Python
2
star
24

django-multilingual

unofficial django-multilingual clone
Python
2
star
25

git-achievements-stats

stefanfoulis' git achievements
1
star
26

cmsplugin-codebragger

Python
1
star
27

django-filer-test

JavaScript
1
star
28

pixlpy

PLANNING: A easy to use effects and image-manipulation library based on PIL (Python).
1
star
29

test

just testing github stuff
1
star
30

react-relay-experiment

Just trying out react and realy for app development awesomeness
JavaScript
1
star
31

buildout.dumprequirements

a simple buildout extension that dumps a requirements.txt file for pip
Python
1
star
32

my-workstation

Notes on my macOS developer workstation setup
1
star
33

stefanfoulis.github.com

Stefan Foulis on github
JavaScript
1
star
34

github-test-playground

A repo to test stuff with github.
1
star
35

epio-sentry

configuration to run a sentry server instance on ep.io
1
star
36

django-codebragger

brag about your opensource projects on your website
Python
1
star
37

timelapse-manager

A django project to manage timelapse images and generate movies.
JavaScript
1
star
38

django-imagefiler2filer

1
star
39

django-filer-travis-testing

Python
1
star
40

django-sendsms-gh-ci-experiment

Trying out github actions as ci for django-sendsms
Python
1
star
41

django-epioprices

A really, really simple django app that uses admin to calculate prices of custom ep.io configurations.
Python
1
star
42

sweetns

A redis powered DNS server based on Twisted
Python
1
star
43

nginx-proxy-network-joiner

A sidekick container for jwilder/nginx-proxy that auto joins networks so it works seamless witch docker-compose networks.
Python
1
star
44

docker-python

An opinionated python base image.
Python
1
star