[英]send activation email django-registration (Amazon SES)
How to send activation email with username by using django-registration
.I've configured Amazon SES
on server. 如何使用django-registration
发送带有用户名的激活电子邮件。我已经在服务器上配置了Amazon SES
。
Here is my settings 这是我的设定
AWSAccessKeyId='my_key'
AWSSecretKey='my_key'
EMAIL_BACKEND = 'django_ses.SESBackend`
When User trying to register. 当用户尝试注册时。 They get following error message. 他们得到以下错误信息。 Will you please help me ? 你能帮我吗? Thank you 谢谢
NoAuthHandlerFound at /accounts/register/
No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials
I'm doing something wrong? 我做错了吗? please help 请帮忙
'Check your credentials' % (len(names), str(names)))
NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials
I've made some changes in settings.py
我在settings.py
进行了一些更改
AWS_ACCESS_KEY_ID='my_key'
AWS_SECRET_ACCESS_KEY='my_key'
Now I'm getting following error. 现在我得到以下错误。
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>
You need to verify the email address that you are sending the emails from before amazon will accept the emails. 您需要先验证要从中发送电子邮件的电子邮件地址,然后亚马逊才会接受这些电子邮件。
From the Amazon SES page : 从Amazon SES页面 :
Verify Email Addresses : Before you can send email via Amazon SES, you need to verify that you own the address from which you'll be sending email. 验证电子邮件地址 :在通过Amazon SES发送电子邮件之前,您需要验证您是否拥有发送电子邮件的地址。 To start the verification process, visit the AWS Management Console . 要开始验证过程,请访问AWS管理控制台 。
Before you check whether django-registration can send emails, make sure that sending emails works from the shell 在检查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)
Any error messages might give you a clue what to try next. 任何错误消息都可能为您提供下一步尝试的线索。 If send_mail
works, then django registration is probably using the wrong address. 如果send_mail
有效,则Django注册可能使用了错误的地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.