@shared_task
def forgot_email(subject,user_cipher,key_cipher,to):
print "comes here in the mail"
try:
email_content = {'user_cipher':user_cipher,'key_cipher': key_cipher}
message = render_to_string('forgot_password.txt',email_content)
send_mail(subject, message, settings.EMAIL,to, fail_silently=False)
except Exception,e:
print "Exception",e
except:
print 'exp'
@shared_task
def multiplesendmail(subject,body,first_name,to):
print "comes here in the mail"
try:
print 'subject',subject,'body',body,'first_name',first_name,'to',to
# email_content = {'first_name':first_name,'user_cipher':user_cipher,'key_cipher':key_cipher}
# message = render_to_string('email_verification.txt', email_content)
send_mail(subject,body,settings.EMAIL,to,fail_silently=False)
except Exception,e:
print "Exception",e
注意-我想在不停止 celery 的情况下添加新任务。我必须先用这个停止芹菜,然后
celery -A HealthBrio worker -l info