Skip to content

Django mail backend uses celery as email message queue

License

Notifications You must be signed in to change notification settings

jar3b/django-queued-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-queued-mailer

Django mail backend uses celery as email message queue

requirements

Django >= 1.11, Celery >= 4.1.1

setup

  • Add git+https://github.com/jar3b/django-queued-mailer.git to requirements.txt
  • Install package pip install --upgrade git+https://github.com/jar3b/django-queued-mailer.git
  • Modify Django settings: set proper email backend
EMAIL_BACKEND = 'queued_mailer.backend.EmailBackend'
  • Run celery worker
celery -A project worker

run one task at time (optional)

  • setup Celery routes
app.conf.task_queues = (
    Queue('default', Exchange('default'), routing_key='default'),
    Queue('qmailer_mail_queue', routing_key='qmailer.send.#'),
)
  • start separate worker
celery -A project worker -Q qmailer_mail_queue --concurrency=1

configure

Django settings:

  • QMAILER_EMAIL_BACKEND - set email backend, default django.core.mail.backends.smtp.EmailBackend
  • QMAILER_TASK_QUEUE_NAME - queue name for routing, default default, if you use separate "serial" worker as described above, you need to specify this option

About

Django mail backend uses celery as email message queue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages