from templated_mail.mail import BaseEmailMessage
from django.contrib.auth.tokens import default_token_generator

from djoser import utils
from djoser.conf import settings


class PasswordResetEmail(BaseEmailMessage):
    template_name = "email/reset_password.html"

    def get_context_data(self):
        context = super().get_context_data()

        user = context.get("user")
        context["uid"] = utils.encode_uid(user.pk)
        context["token"] = default_token_generator.make_token(user)
        context["url"] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
        return context

201ef2f34bc8a01a14c8d53bf111e3ee33a165cd
<mask token>


class PasswordResetEmail(BaseEmailMessage):
    <mask token>
    <mask token>

<mask token>


class PasswordResetEmail(BaseEmailMessage):
    <mask token>

    def get_context_data(self):
        context = super().get_context_data()
        user = context.get('user')
        context['uid'] = utils.encode_uid(user.pk)
        context['token'] = default_token_generator.make_token(user)
        context['url'] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
        return context

<mask token>


class PasswordResetEmail(BaseEmailMessage):
    template_name = 'email/reset_password.html'

    def get_context_data(self):
        context = super().get_context_data()
        user = context.get('user')
        context['uid'] = utils.encode_uid(user.pk)
        context['token'] = default_token_generator.make_token(user)
        context['url'] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
        return context

from templated_mail.mail import BaseEmailMessage
from django.contrib.auth.tokens import default_token_generator
from djoser import utils
from djoser.conf import settings


class PasswordResetEmail(BaseEmailMessage):
    template_name = 'email/reset_password.html'

    def get_context_data(self):
        context = super().get_context_data()
        user = context.get('user')
        context['uid'] = utils.encode_uid(user.pk)
        context['token'] = default_token_generator.make_token(user)
        context['url'] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
        return context

from templated_mail.mail import BaseEmailMessage
from django.contrib.auth.tokens import default_token_generator

from djoser import utils
from djoser.conf import settings


class PasswordResetEmail(BaseEmailMessage):
    template_name = "email/reset_password.html"

    def get_context_data(self):
        context = super().get_context_data()

        user = context.get("user")
        context["uid"] = utils.encode_uid(user.pk)
        context["token"] = default_token_generator.make_token(user)
        context["url"] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
        return context
