PasswordResetView: протокол контекстной переменной возвращает http вместо https

Я использую модуль регистрации Django в одном из моих приложений стек : django/postgresql/docker

Я отменяю просмотр сброса пароля:

class ResetPasswordView(SuccessMessageMixin, PasswordResetView):

    template_name = 'registration/password_reset_form.html'
    email_template_name = 'registration/password_reset_email.html'
    subject_template_name = 'registration/password_reset_subject.txt'
    success_message = "We've emailed you instructions for setting your password, " \
                      "if an account exists with the email you entered. You should receive them shortly." \
                      " If you don't receive an email, " \
                      "please make sure you've entered the address you registered with, and check your spam folder."
    success_url = reverse_lazy('home')

и следующий шаблон для сброса пароля:

Someone asked for password reset for email {{ email }}. 
Follow the link below:
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}

PS : Please do not reply to this email

но контекстный протокол шаблона электронной почты возвращает http вместо https

что случилось?

Вы можете построить свой url внутри View, в методе get_context_data() и использовать request.build_absolute_uri()

Вернуться на верх