Skip to main content
# django-nexmo

`django-nexmo` is a tiny Django app to send sms using the Nexmo provider.

## Installation

Installation using pip is simple:

$ pip install django-nexmo

Add the `nexmo` app to your installed applications:

INSTALLED_APPS = (
…
'nexmo',
…
)

## Configuration

You need to add a few lines in your `settings.py` file for django-nexmo to work:

NEXMO_USERNAME = 'username'
NEXMO_PASSWORD = 'password'
NEXMO_FROM = 'Name or phone'

Did I mention that you need a [Nexmo account](https://www.nexmo.com/)?
Seems quite obvious to me.


## Basic usage

The `nexmo` apps gives you access to a shortcut to send text messages easily.

from nexmo import send_message
send_message('+33612345678', 'My sms message body')

Is that all? Yes… for now.


## Advanced usage

`django-nexmo` embeds [libpynexmo by Marco Londero](https://github.com/marcuz/libpynexmo).
Therefore, you can import and use the `NexmoMessage` class to manually forge
requests to the Nexmo API.

from nexmo.libpynexmo.nexmomessage import NexmoMessage


params = {
'api_key': settings.NEXMO_USERNAME,
'api_secret': settings.NEXMO_PASSWORD,
'type': 'unicode',
'from': settings.NEXMO_FROM,
'to': to,
'text': message.encode('utf-8'),
}
sms = NexmoMessage(params)
response = sms.send_request()


## Handling callbacks

Nexmo can call one of your urls to send further details about a text message processing.

`django-nexmo` provides a very basic callback handler that does nothing but logging
Nexmo calls.

In your main `urls.py` file:

urlpatterns = patterns('',
…
url(r'^nexmo/', include('nexmo.urls')),
…
)

This will declare a callback view accessible through the
http://your-site.url/nexmo/callback/ url.

Copy this url and paste it in the "Callback URL" section of your "API settings"
section of your Nexmo.com account.

Metadata

Release files for django-nexmo 1.0.1

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-nexmo 1.0.1
File Size Uploaded Provenance Actions
django-nexmo-1.0.1.tar.gz 8.6 kB Without provenance Details for django-nexmo-1.0.1.tar.gz

Release files / django-nexmo-1.0.1.tar.gz

Download URL django-nexmo-1.0.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f17bdf046326725332a0e38cde5732326183f96c9bb6953c92a640f33b898e87
BLAKE2b-256 checksum
How to use checksums
3d0cdc8f2a596c71cf523f1cdc546c4172c94c5c267db8f5bf35954b34fedffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-nexmo 1.0.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.

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