all-auth SMTPAuthentication 错误

all-auth SMTPAuthentication Error

我收到 SMTPAuthenticationError at /rest-auth/password/reset/ 错误。

我正在使用 all-auth-rest 并将这些设置为 settings.py

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'randomemail@gmail.com'
EMAIL_PORT = 25 # or 587
EMAIL_HOST_PASSWORD = 'mypassword'

我还启用了 Displaying an Unlock Captcha 并允许 less secure app access

少了什么?

谢谢

This configurations is if you work with smtp.gmail.com, other smtp is similiar with this configuration.

  1. 解锁验证码:https://accounts.google.com/DisplayUnlockCaptcha
  2. 更改为活动:https://www.google.com/settings/security/lesssecureapps

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'your_gmail@gmail.com'
EMAIL_HOST_PASSWORD = 'your_password'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

我想你错过了:EMAIL_BACKEND