Skip to main content

Reusable application for Django introducing a message delivery framework

Project description

https://github.com/idlesign/django-sitemessage

LBC Python 2
https://img.shields.io/pypi/v/django-sitemessage.svg https://img.shields.io/pypi/l/django-sitemessage.svg https://img.shields.io/coveralls/idlesign/django-sitemessage/master.svg https://travis-ci.org/idlesign/django-sitemessage.svg?branch=master

Description

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 sitemessages.py in one of your apps):

from sitemessage.toolbox import register_messenger_objects
from sitemessage.messengers.smtp import SMTPMessenger

register_messenger_objects(
    # Here we register one messenger to deliver emails.
    # By default it uses mailing related settings from Django settings file.
    SMTPMessenger()
)
  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, 'user2@host.com'], sender=request.user)

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

    ./manage.py sitemessage_send_scheduled

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

Documentation

http://django-sitemessage.readthedocs.org/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sitemessage-1.3.2.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

django_sitemessage-1.3.2-py2.py3-none-any.whl (51.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-sitemessage-1.3.2.tar.gz.

File metadata

  • Download URL: django-sitemessage-1.3.2.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for django-sitemessage-1.3.2.tar.gz
Algorithm Hash digest
SHA256 65ac59c88104e24bf1a37e87e71c6ff5390f5c11c39cb09a38b1ccc3b4720dc4
MD5 6748f5b05e83bd7a02d4040c61fbf2ed
BLAKE2b-256 c1107d7b166f0e040f6f0dffe9cf2918c50abdc0f17c61142e8a3960468dd3fb

See more details on using hashes here.

File details

Details for the file django_sitemessage-1.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_sitemessage-1.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e884d4092407e34effc4ec684977bde1dd2ccf8e8b4a1ce58b09bd91464b5079
MD5 beb451dd98c1ea49b6d5221cd400923d
BLAKE2b-256 1c1afd343df55247c1b68d37dec2fb4dcf247aeab3e89d31243f8c3af2fc69b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page