This app will send periodic email alert using CELERY and CELERY-BEAT After hitting specific django API
sudo apt-get install erlang
sudo apt-get install rabbitmq-server
sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server
sudo systemctl status rabbitmq-server
sudo rabbitmq-plugins enable rabbitmq_management
default username: guest
default password: guest
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST_USER = "[email protected]" <!--- put your email here. --->
EMAIL_HOST = "smtp.gmail.com"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_PASSWORD = 'PASSWORD' <!--- put your email password here.)--->
EMAIL_RECEIVER_LIST = ['RECEIVER1','RECEIVER2']
CELERY_BROKER_URL = 'amqp://guest:guest@localhost'
worker_redirect_stdouts_level = 'ERROR'
CELERY_TIMEZONE = 'Asia/Kolkata'
CELERY_BEAT_SCHEDULE = {
'hourly_pullevents': {
'task': 'telecom.tasks.send_email_task',
'schedule': crontab(minute='*/2', hour='*'), <!--- This will send email after every 2 min.--->
},
python3 manage.py runserver
celery -A myapi worker -l info
celery -A myapi beat -l info