[英]Reset Password in django?
I am following a blog to reset the password in django. 我正在关注一个博客以重置django中的密码。 It states to add :
它指出要添加:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # During development only
in settings.py file. 在settings.py文件中。
But I want to deploy my web application in production. 但是我想在生产环境中部署我的Web应用程序。 So what steps should I take care about?
那么我应该注意哪些步骤? Will this tutorial is safe for the production too?
本教程对生产也安全吗?
The blog link is given below: 博客链接如下:
https://simpleisbetterthancomplex.com/tutorial/2016/09/19/how-to-create-password-reset-view.html https://simpleisbetterthancomplex.com/tutorial/2016/09/19/how-to-create-password-reset-view.html
As it is mentioned in tutorial it is only for Development
. 正如本教程中提到的,它仅用于
Development
。 But when you move to prodution you need to configure it properly based on your SMTP
type. 但是,当您转向生产时 ,需要根据
SMTP
类型正确配置它。 I'll specify it all here: 我将在这里指定所有内容:
For production (DEBUG=False) 用于生产(DEBUG = False)
SMTP Email- EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
Server - EMAIL_HOST=127.0.0.1
(Standard)- EMAIL_PORT=25
EMAIL_HOST_USER=<smtp_user>
EMAIL_HOST_PASSWORD=<smtp_user_pwd>
If the SMTP email server is running on a network or a different port than the default, adjust EMAIL_HOST and EMAIL_PORT accordingly. 如果SMTP电子邮件服务器运行在网络或不同于默认端口的端口上,请相应地调整EMAIL_HOST和EMAIL_PORT。
In today's email spam infested Internet, nearly all SMTP email servers require authentication to send email. 在当今电子邮件垃圾邮件泛滥的Internet中,几乎所有SMTP电子邮件服务器都需要身份验证才能发送电子邮件。 If your SMTP server doesn't require authentication you can omit EMAIL_HOST_USER and EMAIL_HOST_PASSWORD.
如果您的SMTP服务器不需要身份验证,则可以省略EMAIL_HOST_USER和EMAIL_HOST_PASSWORD。
Django email configuration for Gmail or Google Apps account Gmail或Google Apps帐户的Django电子邮件配置
This is all you need to set up a default email connection to Gmail or Google Apps in Django. 这就是设置默认电子邮件连接到Django中的Gmail或Google Apps所需要的。 In your
settings.py
use this code with your credentials: 在您的
settings.py
将此代码与您的凭据一起使用:
EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT=587
EMAIL_HOST_USER='username@gmail.com/OR/username@coffeehouse.com'
EMAIL_HOST_PASSWORD='password'
EMAIL_USE_TLS=True
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.