Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

chore: Send email verification for signing up #1118

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

khushishikhu
Copy link
Member

@khushishikhu khushishikhu commented Sep 14, 2020

Description

changes made for verification of email when the user logged in for the first time

Fixes #1029

Type of Change:

  • Code
  • Quality Assurance
  • Outreach
  • Documentation

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@khushishikhu
Copy link
Member Author

@keshakaneria please review my PR

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'Khushi17@'
EMAIL_HOST_USER = 'dpskhu13108@gmail.com'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to remove your personal email ID

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'
Copy link
Member

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

Copy link
Member

@keshakaneria keshakaneria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the personal ID and keep the deleted portion of printing it in console for development purpose.

@keshakaneria
Copy link
Member

Build is failing due to these problem from here to here. Did you try to test after completing the required task done? Did the console show any error?

@khushishikhu
Copy link
Member Author

Build is failing due to these problem from here to here. Did you try to test after completing the required task done? Did the console show any error?

yes it was appearing to me in console but i am still working to figure it out.

EMAIL_HOST_PASSWORD = 'your_password'
EMAIL_HOST_USER = 'your_email'
EMAIL_PORT = 587
EMAIL_USE_TSL = True

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The 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 :)

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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 :)

Choose a reason for hiding this comment

The 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 config() function is used (from a 3rd party package) which basically loads the required settings from a .env file.

@keshakaneria
Copy link
Member

Any updates?

@khushishikhu
Copy link
Member Author

v
@keshakaneria sorry, actually i am struck with this error whenever i try to send mail from django . can you please help me out

@keshakaneria
Copy link
Member

Have a look at this error. It might help you to resolve.

@khushishikhu
Copy link
Member Author

vol
i don't know why i am getting this error whenever i am signing up. after my changes

@keshakaneria
Copy link
Member

@SanketDG Can you help us out how according to you explained me in above comments shall we proceed with the changes?

@khushishikhu
Copy link
Member Author

@keshakaneria please help me fix it. i am not getting why is this error is coming

@SanketDG
Copy link

@khushishikhu
Copy link
Member Author

@SanketDG i run this command in psql as shown in screenshot but its again showing me this same error
Capture

@keshakaneria
Copy link
Member

Did you try to figure this out @khushishikhu ?

@khushishikhu
Copy link
Member Author

@keshakaneria yes i tried a lot but turns out getting these errors again and again. can you please help me to resolve these errors because i think if there won't be these errors the issue has been done
Capture
Capture2

@keshakaneria
Copy link
Member

I see! It will be better if we can discuss this error to solve this problem on Zulip. We'll make through it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add task using Celery to send email verification for signing up
3 participants