-
Notifications
You must be signed in to change notification settings - Fork 4
chore: Send email verification for signing up #1118
base: develop
Are you sure you want to change the base?
Changes from 5 commits
5c33497
89edb65
3677cc1
3118a82
d19cb9b
7be3d75
6c9a1f4
a739dab
0b2322f
97dc555
b2302b6
84026c7
a1653cb
1c9ac9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,10 +129,17 @@ | |
|
||
# Instead of sending out real email, during development the emails will be sent | ||
# to stdout, where from they can be inspected. | ||
if DEBUG: | ||
EMAIL_HOST = config('EMAIL_HOST', default='localhost') | ||
EMAIL_PORT = config('EMAIL_PORT', default=1025, cast=int) | ||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
# if DEBUG: | ||
# EMAIL_HOST = config('EMAIL_HOST', default='localhost') | ||
# EMAIL_PORT = config('EMAIL_PORT', default=1025, cast=int) | ||
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | ||
EMAIL_HOST = 'smtp.gmail.com' | ||
EMAIL_HOST_PASSWORD = 'your_password' | ||
EMAIL_HOST_USER = 'your_email' | ||
EMAIL_PORT = 587 | ||
EMAIL_USE_TSL = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this change 🤔 It's supposed to be like that so we can test easily during local dev There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I don't think while pushing the changes we usually keep the email addresses and the passwords. The one who clones it, needs to add their personal ones before running this. This is what I learnt in my Internship. If I am wrong, do correct me :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the late response but could you elaborate on that? I do not get you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. What we used to do like whenever we used to push the changes in authentication part regarding login or signups, we deleted the dummy email Id used. Because after the changes are merged this email ID and password wont be valid for the other person who tries to clone and run. So kept that field empty and whenever someone tries to run, s/he must first put in their id and password in order to try the emails sent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are not supposed to do that way here then do let me know if I am wrong :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. I will try to explain. So basically, first things first, for anything that depends on an external service, it's generally much more efficient to keep it configurable, and that's exactly what's done here. If you can imagine, if for an external service like mail, we keep it hardcoded it can lead to all sorts of abuse, that is why the |
||
|
||
LOGIN_REDIRECT_URL = reverse_lazy('home:index') | ||
RECOVER_ONLY_ACTIVE_USERS = False | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep this in comments for better understanding rather than just removing it completely