作者:mobiledu2502915773 | 来源:互联网 | 2023-05-17 09:12
Icurrentlyamusingdjango-password-resettoassistuserswhentheyforgetapassword.Everythingw
I currently am using django-password-reset to assist users when they forget a password. Everything worked just fine while in development but now I am having issues setting up the email backend on my production server.
我目前正在使用django-password-reset来帮助用户忘记密码。在开发过程中一切正常,但现在我在生产服务器上设置电子邮件后端时遇到问题。
When a user enters their username or email into the password reset form and push the 'Recover Password' button that would normally trigger the password-reset email, the page starts to load infinitely. I am attempting to use a gmail account as my smtp server. I am assuming that there is some sort of issue with my settings.py file.
当用户将用户名或电子邮件输入密码重置表单并按下通常会触发密码重置电子邮件的“恢复密码”按钮时,页面将开始无限加载。我试图使用Gmail帐户作为我的smtp服务器。我假设我的settings.py文件存在某种问题。
settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'example@gmail.com'
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'example@gmail.com'
If you have any idea what is wrong with my configuration or any other ways to set up my email backend advice would be greatly appreciated! Thanks
如果您知道我的配置有什么问题,或者设置我的电子邮件后端的任何其他方式建议将不胜感激!谢谢
1 个解决方案