pythonpython-3.xdjangoapollographene-django

Django + Graphene, after registering a user, a confirmation letter has arrived in the developer's console. How can I get control of this email?


I am learning Django + Graphene + React(Apollo), after registering a user, a confirmation email has come to the developer console. How can I get control of this email?

class AuthMutation(graphene.ObjectType):
    register = mutations.Register.Field()
    verify_account = mutations.VerifyAccount.Field()

After I send data from the client side, the user is registered, but to confirm it, I have to perform a mutation with the token that comes in the letter.

mutation {
  verifyAccount(token: "YOUR TOKEN FROM LETTER") {
    success,
    errors
  }
}

Letter

<h3>{{ site_name }}</h3>

<p>Hello {{ user.username }}!</p>
<p>Please activate your account on the link:</p>

<p>{{ protocol }}://{{ domain }}/{{ path }}/{{ token }}</p>

My goal is to confirm registration via email


Solution

  • Added the following code to Settings.py file

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = 'smtp.gmail.com'
    EMAIL_HOST_PASSWORD = 'password' #my gmail password
    EMAIL_HOST_USER = 'email' #my gmail username
    EMAIL_PORT = 587