I have customized my Django reset password template but every time I send reset password emails they are sent as html which hasn't been converted into a string A good example is this
<p>please go to the following page and choose a new password:</p>
<h5>
http://127.0.0.1:8000/api/accounts/reset/MQ/52b-204bbaf9b94c438dff7e/
Thanks for using our site!
</h5>
This is how it appears my inbox. My code is follows: urls.py
urlpatterns = [
path('signup', UserCreate.as_view(), name='signup'),
path('login', UserLoginAPIView.as_view(), name='login'),
re_path(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
activate, name='activate'),
path('password/reset', PasswordResetView.as_view(),
{'template_name': 'templates/registration/password_reset_email.html',
'html_email_template_name': 'templates/registration/password_reset_email.html',
'subject_template_name': 'templates/registration/password_reset_subject.txt',
'from_email': config('EMAIL_HOST_USER'),
'extra_email_context': 'templates/registration/password_reset_email.txt',
},
name='password_reset'),
path('password/reset/done', PasswordResetDoneView.as_view(),
{'template_name': 'templates/registration/password_reset_done.html'},
name='password_reset_done'),
re_path(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', PasswordResetConfirmView.as_view(),
name='password_reset_confirm'),
path('reset/done/', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
]
password_reset.html
<p>please go to the following page and choose a new password:</p>
<h5>
http://127.0.0.1:8000{% url 'password_reset_confirm' uidb64=uid token=token %}
Thanks for using our site!
</h5>
I have done research on how I can convert html to a string with no success