skip to navigation
skip to content

django-sitemessage 0.9.0

Reusable application for Django introducing a message delivery framework


Reusable application for Django introducing a message delivery framework.

Schedule and send messages with several easy steps, using concepts of:

  • Messengers - clients for various protocols (smtp, jabber, twitter, telegram, facebook, vkontakte, etc.);
  • Message Types - message classes exposing message composition logic (plain text, html, etc.).
  1. Configure messengers for your project (create in one of your apps):
from sitemessage.toolbox import register_messenger_objects, register_builtin_message_types
from sitemessage.messengers.smtp import SMTPMessenger

    # Here we register only one messenger to deliver emails.
    SMTPMessenger('', 'user1', 'user1password', host='', use_tls=True)

# And register built-in message types we'd use (for Django < 1.7).
  1. Schedule messages for delivery when and where needed (e.g. in a view):
from sitemessage.shortcuts import schedule_email

def send_mail_view(request):

    # Suppose `user_model` is a recipient Django User model instance.
    user1_model = ...

    # We pass `request.user` into `sender` to keep track of senders.
    schedule_email('Message from sitemessage.', [user1_model, ''], sender=request.user)

  1. Periodically run Django management command from wherever you like (cli, cron, Celery, etc.):

    ./ sitemessage_send_scheduled

And that’s only the tip of sitemessage iceberg, read the docs %)

File Type Py Version Uploaded on Size
django-sitemessage-0.9.0.tar.gz (md5) Source 2017-12-16 50KB
django_sitemessage-0.9.0-py2.py3-none-any.whl (md5) Python Wheel 2.7 2017-12-16 52KB