是他做異步的正確方法調用Python中的功能?什麼是發送郵件異步在Python/Django的正確方法是什麼?
起始密碼
pool = Pool(processes=4)
pool.apply_async(send_email, ['CONFIRM', email, auth_token, password, "", first_name])
功能
def send_email(flag, email, auth_token='', password='', shared_by='', name=''):
try :
send_mail('Greetings!', 'Hi '+str(name)+'\nThank you for checking us out!'
'Please click on the link below to activate your subscription.\n' + confirmation_link +
'\npassword : ' + password, '[email protected]', [email],
fail_silently=False)
except SMTPException as e:
print e
有我看了網上的文檔?
是的,我有,但它嚴重並沒有多大幫助。所以我在這裏尋求幫助。
您已閱讀在線文檔,但您沒有告訴我們您的工作有什麼問題。 –
我想知道這是否是異步需要做的呢? – cafebabe1991
它在最上面的@ShangWang的問題 – cafebabe1991