0

I am new to celery trying to send email but I am unable to receive mail.

settings.py

import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'

INSTALLED_APPS = (
'grappelli',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'raven.contrib.django.raven_compat',
'simple_pagination',
'haystack',
'pmt_admin',
'pmt_site',
'django_nose',
'social',
'djcelery',
'kombu.transport.django',
'endless_pagination',
'compressor',

)

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'Company Name'
EMAIL_HOST_PASSWORD = 'xxxxxxxx'
EMAIL_PORT = 587
EMAIL_USE_TLS = True

tasks.py

from celery import task
from django.core.mail import send_mail

@task()
def smail():
send_mail("celery_testing", "Celery worked", "Company Name",
    ["tomail@gmail.com"], fail_silently=False)

python manage.py shell

>>> smail.delay()
<AsyncResult: be15f163-d18d-40f6-b6f9-c3de3a6aa342>

when I run kombu broker python manage_local.py celery worker --loglevel=info I am getting error like

enter image description here

Rama Krishna
  • 275
  • 3
  • 12

1 Answers1

0

I think at this point your problem isn't with Kombu. It seems that this ImportError is caused because you don't specify on INSTALLED_APPS mpcomp app.

Try:

INSTALLED_APPS += ('mpcomp',)