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:
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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…