无法使用kombu作为经纪人使用芹菜发送邮件

时间:2015-10-05 07:50:54

标签: python django django-celery kombu

我是芹菜尝试发送电子邮件的新手,但我无法收到邮件。

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>

当我经营kombu经纪人时 python manage_local.py芹菜工人--loglevel = info 我收到了像

这样的错误

enter image description here

1 个答案:

答案 0 :(得分:0)

我认为此时你的问题不是Kombu。似乎导致此ImportError是因为您未在INSTALLED_APPS User *user=(User *)[usersArray objectAtIndex:indexPath.row]; yourLabel.text=user.firstName; 应用上指定。

尝试:

mpcomp