Access is invite-only during beta. Once invited, create a key to personalize these examples. Production sending requires a separate review.

Send emails with Django

Use the PostShiba EmailBackend and django.core.mail.

The backend calls emails.send. import postshiba does not load Django.

send.py
1 from django.core.mail import EmailMultiAlternatives
2
3 message = EmailMultiAlternatives(
4 subject="Hello",
5 body="Hi",
6 from_email="hello@mail.example.com",
7 to=["you@example.com"],
8 )
9 message.attach_alternative("<p>Hi</p>", "text/html")
10 message.send()
settings.py
1 EMAIL_BACKEND = "postshiba.django.EmailBackend"
2 POSTSHIBA_API_KEY = "YOUR_API_KEY"

Django 6.1 and later can use MAILERS instead.

mailers.py
1 MAILERS = {
2 "default": {
3 "BACKEND": "postshiba.django.EmailBackend",
4 }
5 }
6 POSTSHIBA_API_KEY = "YOUR_API_KEY"

Installation

install.sh
1 pip install "git+https://github.com/postshiba/postshiba-python.git#egg=postshiba[django]"

Not on PyPI yet. Open pull requests on postshiba/sdks.

Errors and throttling

Failed responses raise postshiba.Error with error, field, and message.

A 429 with error throttled means the cluster hit its hourly throttle or its 24-hour cap. Do not retry that send immediately. Immediate retries hit the same cap.

The Django backend does not delay for you. In a queued task, catch postshiba.Error and check e.error == "throttled" before sending again.

See Errors.

About

PostShiba is the email platform that powers Bento behind the scenes. You can build your own products, like Bento, on top of it.

© 2026 PostShiba by Backpack Internet Pty. Ltd. All rights reserved.

The same policies that govern Bento are applied to PostShiba Privacy | Terms | Security