Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
191 views
in Technique[技术] by (71.8m points)

Django Email Token Sending Blocked

For a user registration, I try and send a url that the user has to click in order to register. This url contains a uid, and token. However, gmail seems to block emails from the specified email in settings.py when I try and send them. I think it's because my local address is used as the website for now and which is seen as 'less secure' but I am not exactly sure why. I know it has to do with the token because when I send an email with just text in the body, it does not pose an error. The error is shown as below:

Image of error

Here is the email body (note that when I simply change this to text, the email is sent):

                email_body = render_to_string('mainapp/acc_activate_email.html', {
                'user': user,
                'domain': current_site.domain,
                'uid': urlsafe_base64_encode(force_bytes(user.pk)),
                'token': default_token_generator.make_token(user),
            })
question from:https://stackoverflow.com/questions/65837123/django-email-token-sending-blocked

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...