html 템플릿 적용 X
# 인증 이메일 전송
message = render_to_string('email_valid.html', {
'user': user,
'domain': 'http://127.0.0.1:8000',
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': account_activation_token.make_token(user),
})
mail_subject = "MMOP 이메일 인증 링크 보내드립니다"
to_email = user.email
email = EmailMessage(mail_subject, message, to=[to_email])
email.send()
이렇게 이메일을 보내니까
템플릿이 적용이 안되고 그냥 코드로만 날라오더라
별짓을 다해도 안되다가 render_to_string 때문인가????
# 인증 이메일 전송
message = render_to_string('email_valid.html', {
'user': user,
'domain': 'http://127.0.0.1:8000',
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': account_activation_token.make_token(user),
})
plain_message = strip_tags(message)
mail_subject = "MMOP 이메일 인증 링크 보내드립니다"
to_email = user.email
mail.send_mail(mail_subject, plain_message, settings.EMAIL_HOST_USER, [to_email], html_message=message)
이메일 인증을 하고나니 다시 비밀번호 찾기가 안된다..ㅎ
와이라노...... 와이라노..........
django.urls.exceptions.NoReverseMatch: Reverse for 'password_reset' not found. 'password_reset' is not a valid view function or pattern name.
후.... 그것은 app_name을 내가 설정해줬기 때문
app_name을 설정해 줬으면
<form method="post" action="{% url 'password_reset' %}">
이렇게 써줬어야한다..
728x90
'프로젝트 > MMOP(추천시스템_최종프로젝트)' 카테고리의 다른 글
사용자 피드백(12/19) (0) | 2022.12.21 |
---|---|
발표(12/15, KTP 회고) (0) | 2022.12.21 |
이메일 인증 (0) | 2022.12.07 |
마이페이지 프로필 탭 API 연결 (0) | 2022.12.06 |
DRF HTTP 404 Not Found Error (0) | 2022.12.05 |
댓글