Email async notifications with celery.
Project description
Async notifications
Email notification with celery and administrative view for send email with delay e.g daily
Features
Celery integration
Administrative view
Enqueued mail system and instantly send
Problems notification
User filter email
Template system with template context
Send to User, Group or external email
Django cms integration (djcms_async_notifications) and standalone.
Installation
Install from pip
$ pip install async_notifications
Insert async_notifications in your settings INSTALLED_APPS
It’s really important set CELERY_MODULE pointing to your project celery file, because it’s needed for assing task to the current project, and configure some default celery options
from __future__ import absolute_import CELERY_MODULE = "demo.celery" CELERY_TIMEZONE = TIME_ZONE CELERY_ACCEPT_CONTENT = ['pickle', 'json'] from celery.schedules import crontab CELERYBEAT_SCHEDULE = { # execute 12:30 pm 'send_daily_emails': { 'task': 'async_notifications.tasks.send_daily', 'schedule': crontab(minute=30, hour=0), }, }
Configure your email settings, e.g for development
DEFAULT_FROM_EMAIL="mail@example.com" EMAIL_HOST="localhost" EMAIL_PORT="1025"
Run migrations
$ python manage.py migrate
Runing the project
You need to run 3 subsystems for run this app so you need 3 xterm, for this explanation I will use the demo project
Run smtp debug client
$ python -m smtpd -n -c DebuggingServer localhost:1025
Run celery, if you aren’t setup celery yet see celery documentation.
$ celery -A demo worker -l info -B
Run django
$ python manage.py runserver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for async_notifications-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e2016651972e22fb2079e98925065c789faa3bb6bc8f85716fc6c8b7e0abb3 |
|
MD5 | b4751a0518d68db68d46e1e9b212d197 |
|
BLAKE2b-256 | 0225f425d3dfa1013fadd8527a0588e5c76850489de6710690e3deb5e2ae019c |