2015-10-05 57 views
0

我是新來的芹菜試圖發送電子郵件,但我無法接收郵件。無法使用芹菜作爲經紀人發送郵件

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", 
    ["[email protected]"], fail_silently=False) 

蟒manage.py殼

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

當我運行海帶經紀人 蟒蛇manage_local.py芹菜工人--loglevel =信息 我越來越喜歡

enter image description here

回答

0

我認爲錯誤在這一點上你的問題是不是與海帶。看來這個ImportError是因爲你沒有在INSTALLED_APPS mpcomp應用中指定而引起的。

嘗試:

INSTALLED_APPS += ('mpcomp',) 
相關問題