All Projects → pmclanahan → Django Celery Email

pmclanahan / Django Celery Email

Licence: bsd-3-clause
A Django email backend that uses a celery task for sending the email.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Celery Email

Django Celery Results
Celery result back end with django
Stars: ✭ 337 (-3.99%)
Mutual labels:  django, celery
Django Pushy
Your push notifications handled at scale.
Stars: ✭ 168 (-52.14%)
Mutual labels:  django, celery
Django Celery Docker Example
Example Docker setup for a Django app behind an Nginx proxy with Celery workers
Stars: ✭ 149 (-57.55%)
Mutual labels:  django, celery
Autoops
linux资产管理,cmdb,django, webssh,运维管理平台,数据库操作平台 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 340 (-3.13%)
Mutual labels:  django, celery
Celery Progress
Drop in, configurable, dependency-free progress bars for your Django/Celery applications.
Stars: ✭ 230 (-34.47%)
Mutual labels:  django, celery
Django Structlog
Structured Logging for Django
Stars: ✭ 127 (-63.82%)
Mutual labels:  django, celery
Django Guid
Inject an ID into every log message from a Django request. ASGI compatible, integrates with Sentry, and works with Celery
Stars: ✭ 166 (-52.71%)
Mutual labels:  django, celery
Docker Django Example
A production ready example Django app that's using Docker and Docker Compose.
Stars: ✭ 86 (-75.5%)
Mutual labels:  django, celery
Opensa
资产管理、资产采集、灰度发布、反向代理、批量任务、任务编排、计划任务、日志审计、权限管理、角色管理、部门管理、运维自动化
Stars: ✭ 220 (-37.32%)
Mutual labels:  django, celery
Website
django 开发的BBS博客项目, 此项目包含多用户注册,话题模块,发布文章,文章评论,课程、社区BBS以及消息提示,关注,采用邮箱注册,激活验证登录,以及QQ注册登录,招募作者发布教程在后台管理系统发布, pc采用模板渲染,cms采用vue drf前后分离,登录采用JWT认证登录、移动端采用react开发,
Stars: ✭ 217 (-38.18%)
Mutual labels:  django, celery
Django Celery
Old Celery integration project for Django
Stars: ✭ 1,439 (+309.97%)
Mutual labels:  django, celery
Ecommerce website development
本项目基于Django1.8.2等来开发一个电商平台,可实现注册、登录、浏览、购买、支付等全部常用功能。
Stars: ✭ 246 (-29.91%)
Mutual labels:  django, celery
Banking System
A banking System Created Using Django Python Web Framework
Stars: ✭ 105 (-70.09%)
Mutual labels:  django, celery
Dailyfresh
Django-天天生鲜电商学习项目
Stars: ✭ 127 (-63.82%)
Mutual labels:  django, celery
Playlistor
🎶Apple Music ↔️ Spotify playlist convertor.
Stars: ✭ 95 (-72.93%)
Mutual labels:  django, celery
Django School Management
Deployment Ready Developer to Developer Full-stack School Management System with payments, e-admission, result management, academic functionalities, and much more implemented in a simple way.
Stars: ✭ 151 (-56.98%)
Mutual labels:  django, celery
Django Celery Tutorial
Django Celery Tutorial
Stars: ✭ 48 (-86.32%)
Mutual labels:  django, celery
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (-80.34%)
Mutual labels:  django, celery
Dailyfresh B2c
dailyfresh mall based on B2C model
Stars: ✭ 177 (-49.57%)
Mutual labels:  django, celery
Chain
链喵 CMDB 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 240 (-31.62%)
Mutual labels:  django, celery

========================================================== django-celery-email - A Celery-backed Django Email Backend

.. image:: https://img.shields.io/travis/pmclanahan/django-celery-email/master.svg :target: https://travis-ci.org/pmclanahan/django-celery-email .. image:: https://img.shields.io/pypi/v/django-celery-email.svg :target: https://pypi.python.org/pypi/django-celery-email

A Django_ email backend that uses a Celery_ queue for out-of-band sending of the messages.

.. _Celery: http://celeryproject.org/ .. _Django: http://www.djangoproject.org/

.. warning::

This version requires the following versions:

* Python >= 3.5
* Django 2.2, and 3.0
* Celery 4.0

Using django-celery-email

To enable django-celery-email for your project you need to add djcelery_email to INSTALLED_APPS::

INSTALLED_APPS += ("djcelery_email",)

You must then set django-celery-email as your EMAIL_BACKEND::

EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'

By default django-celery-email will use Django's builtin SMTP email backend for the actual sending of the mail. If you'd like to use another backend, you may set it in CELERY_EMAIL_BACKEND just like you would normally have set EMAIL_BACKEND before you were using Celery. In fact, the normal installation procedure will most likely be to get your email working using only Django, then change EMAIL_BACKEND to CELERY_EMAIL_BACKEND, and then add the new EMAIL_BACKEND setting from above.

Mass email are sent in chunks of size CELERY_EMAIL_CHUNK_SIZE (defaults to 10).

If you need to set any of the settings (attributes) you'd normally be able to set on a Celery Task_ class had you written it yourself, you may specify them in a dict in the CELERY_EMAIL_TASK_CONFIG setting::

CELERY_EMAIL_TASK_CONFIG = {
    'queue' : 'email',
    'rate_limit' : '50/m',  # * CELERY_EMAIL_CHUNK_SIZE (default: 10)
    ...
}

There are some default settings. Unless you specify otherwise, the equivalent of the following settings will apply::

CELERY_EMAIL_TASK_CONFIG = {
    'name': 'djcelery_email_send',
    'ignore_result': True,
}

After this setup is complete, and you have a working Celery install, sending email will work exactly like it did before, except that the sending will be handled by your Celery workers::

from django.core import mail

emails = (
    ('Hey Man', "I'm The Dude! So that's what you call me.", '[email protected]', ['[email protected]']),
    ('Dammit Walter', "Let's go bowlin'.", '[email protected]', ['[email protected]']),
)
results = mail.send_mass_mail(emails)

results will be a list of celery AsyncResult_ objects that you may ignore, or use to check the status of the email delivery task, or even wait for it to complete if want. You have to enable a result backend and set ignore_result to False in CELERY_EMAIL_TASK_CONFIG if you want to use these. You should also set CELERY_EMAIL_CHUNK_SIZE = 1 in settings if you are concerned about task status and results.

See the Celery docs_ for more info.

len(results) will be the number of emails you attempted to send divided by CELERY_EMAIL_CHUNK_SIZE, and is in no way a reflection on the success or failure of their delivery.

.. _Celery Task: http://celery.readthedocs.org/en/latest/userguide/tasks.html#basics .. _Celery docs: http://celery.readthedocs.org/en/latest/userguide/tasks.html#task-states .. _AsyncResult: http://celery.readthedocs.org/en/latest/reference/celery.result.html#celery.result.AsyncResult

Changelog

3.0.0 - 2019.12.10

  • Support for Django 3.0
  • Support for Python 3.8
  • Droppped support for Django 1.x, Django 2.0 and Django 2.1
  • Droppped support for Python 2.7

2.0.2 - 2019.05.29

  • Reduce memory usage by running email_to_dict on chunks. Thanks Paul Brown_.
  • Simplify dict_to_email for readability and efficiency. Thanks Paul Brown_.
  • Update test matrix for supported versions of Django, Celery and Python. Thanks James_.

.. _Paul Brown: https://github.com/pawl .. _James: https://github.com/jmsmkn

2.0.1 - 2018.18.27

  • Fix bug preventing sending text/* encoded mime attachments. Thanks Cesar Canassa_.

.. _Cesar Canassa: https://github.com/canassa

2.0 - 2017.07.10

  • Support for Django 1.11 and Celery 4.0
  • Dropped support for Celery 2.x and 3.x
  • Dropped support for Python 3.3

1.1.5 - 2016.07.20

  • Support extra email attributes via CELERY_EMAIL_MESSAGE_EXTRA_ATTRIBUTES setting
  • Updated version requirements in README

1.1.4 - 2016.01.19

  • Support sending email with embedded images. Thanks Georg Zimmer_.
  • Document CELERY_EMAIL_CHUNK_SIZE. Thanks Jonas Haag_.
  • Add exception handling to email backend connection. Thanks Tom_.

.. _Georg Zimmer: https://github.com/georgmzimmer .. _Tom: https://github.com/tomleo

1.1.3 - 2015.11.06

  • Support setting celery.base from string. Thanks Matthew Jacobi_.
  • Use six for py2/3 string compatibility. Thanks Matthew Jacobi_.
  • Pass content_subtype back in for retries. Thanks Mark Joshua Tan_.
  • Rework how tests work, add tox, rework travis-ci matrix.
  • Use six from django.utils.
  • Release a universal wheel.

.. _Matthew Jacobi: https://github.com/oppianmatt .. _Mark Joshua Tan: https://github.com/mark-tan

1.1.2 - 2015.07.06

  • Fix for HTML-only emails. Thanks gnarvaja_.

.. _gnarvaja: https://github.com/gnarvaja

1.1.1 - 2015.03.20

  • Fix for backward compatibility of task kwarg handling - Thanks Jeremy Thurgood_.

.. _Jeremy Thurgood: https://github.com/jerith

1.1.0 - 2015.03.06

  • New PyPI release rolling up 1.0.5 changes and some cleanup.
  • More backward compatability in task. Will still accept message objects and lists of message objects.
  • Thanks again to everyone who contributed to 1.0.5.

1.0.5 - 2014.08.24

  • Django 1.6 support, Travis CI testing, chunked sending & more - thanks Jonas Haag_.
  • HTML email support - thanks Andres Riancho_.
  • Support for JSON transit for Celery, sponsored by DigiACTive_.
  • Drop support for Django 1.2.

.. _Jonas Haag: https://github.com/jonashaag .. _Andres Riancho: https://github.com/andresriancho .. _DigiACTive: https://github.com/digiactive

1.0.4 - 2013.10.12

  • Add Django 1.5.2 and Python 3 support.
  • Thanks to Stefan Wehrmeyer_ for the contribution.

.. _Stefan Wehrmeyer: https://github.com/stefanw

1.0.3 - 2012.03.06

  • Backend will now pass any kwargs with which it is initialized to the email sending backend.
  • Thanks to Fedor Tyurin_ for the contribution.

.. _Fedor Tyurin: https://bitbucket.org/ftyurin

1.0.2 - 2012.02.21

  • Task and backend now accept kwargs that can be used in signal handlers.
  • Task now returns the result from the email sending backend.
  • Thanks to Yehonatan Daniv_ for these changes.

.. _Yehonatan Daniv: https://bitbucket.org/ydaniv

1.0.1 - 2011.10.06

  • Fixed a bug that resulted in tasks that were throwing errors reporting success.
  • If there is an exception thrown by the sending email backend, the result of the task will now be this exception.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].