[英]send activation email django-registration (Amazon SES)
如何使用django-registration
發送帶有用戶名的激活電子郵件。我已經在服務器上配置了Amazon SES
。
這是我的設定
AWSAccessKeyId='my_key'
AWSSecretKey='my_key'
EMAIL_BACKEND = 'django_ses.SESBackend`
當用戶嘗試注冊時。 他們得到以下錯誤信息。 你能幫我嗎? 謝謝
NoAuthHandlerFound at /accounts/register/
No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials
我做錯了嗎? 請幫忙
'Check your credentials' % (len(names), str(names)))
NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials
我在settings.py
進行了一些更改
AWS_ACCESS_KEY_ID='my_key'
AWS_SECRET_ACCESS_KEY='my_key'
現在我得到以下錯誤。
BotoServerError: 400 Bad Request
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>MessageRejected</Code>
<Message>Email address is not verified.</Message>
</Error>
<RequestId>37ceac2e-3861-11e1-acd0-19854590b66c</RequestId>
</ErrorResponse>
您需要先驗證要從中發送電子郵件的電子郵件地址,然后亞馬遜才會接受這些電子郵件。
從Amazon SES頁面 :
驗證電子郵件地址 :在通過Amazon SES發送電子郵件之前,您需要驗證您是否擁有發送電子郵件的地址。 要開始驗證過程,請訪問AWS管理控制台 。
在檢查django-registration是否可以發送電子郵件之前,請確保從外殼程序發送電子郵件有效
./manage.py shell
from django.core.mail import send_mail
verified_address = "from@example.com"
send_mail('Subject here', 'Here is the message.', verified_address,
['to@example.com'], fail_silently=False)
任何錯誤消息都可能為您提供下一步嘗試的線索。 如果send_mail
有效,則Django注冊可能使用了錯誤的地址。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.