===================
A simple Django app to send sms by Skebby.
Usage
-----
In settings.py:
SKEBBY_USERNAME = 'yourskebbyusername'
SKEBBY_PASSWORD = 'yourskebbypassword'
# If SSL cert is not valid
SKEBBY_VERIFY_SSL_CERTIFICATE = False
# If SSL does not work at all
#SKEBBY_URL = "http://gateway.skebby.it/api/send/smseasy/advanced/http.php"
# If you have *requested and obtained* the raise to 100000 messages per request
#SKEBBY_MAX_RECIPIENTS = 100000
# default method is classic
SKEBBY_DEFAULT_METHOD = "basic"
In your code:
from django_skebby.utils import Sms, skebby_credit_left
# greetings to some people
template = "Good {{ festivity }}{% if friend %} {{ friend }}{% endif %}!"
ctx = {'festivity': 'birthday'}
sms = Sms(template, ["39123456789", "3912346788"], sender_string="Your friend", ctx=ctx)
ret = sms.send()
# Skebby has a recipient limit of 50000 numbers that can be raised to 100000 on request
# The app will take care of itself depending on settings.SKEBBY_MAX_RECIPIENTS
failed_requests = [r for r in ret if r.skebby_error]
if failed_requests:
print "some errors!"
# to a special friend
ctx = {'festivity': birthday, 'friend': 'Doge'}
r = sms.send_single(ctx, "3912345679")
if r.skebby_error:
print "failed to greet :( %s" % (r.skebby_response)
# check credit
credit = skebby_credit_left()
if credit.skebby_error:
print "failed to get credit"
else:
print credit.skebby_response
A view that returns the credit in json format is available, to enable it add the app:
INSTALLED_APPS = (
...
'django_skebby',
)
include the urls:
url(r'^skebby/', include('django_skebby.urls')),
add use it:
<script>
$.get('/skebby/credit_left/', function(data) {
console.log(data['credit_left']);
console.log(data['classic_sms']);
console.log(data['basic_sms']);
});
</script>
Metadata
Release files for django-skebby 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-skebby-0.3.1.tar.gz | 5.5 kB | Without provenance | Details for django-skebby-0.3.1.tar.gz |
Release files / django-skebby-0.3.1.tar.gz
| Download URL | django-skebby-0.3.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6a86ba0fe449342d0dc1ffa55738c6421b3ccb44bf2f1d58b07ea9467b4c861
|
|
BLAKE2b-256 checksum How to use checksums |
a0ffaeb316d4fa7b78b7ace7d6484fe23fabd28c174eb1053430a01c65daf8ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-skebby 0.3.1
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.