Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

237
Visualizações
auth_views.password_reset keeps rendering the root url template, not the password reset one

urls.py for my_app:

urlpatterns = [

    # 4 inbuilt views for password reset:
    # - password_reset sends the mail
    # - password_reset_done shows a success message for the above
    # - password_reset_confirm checks the link the user clicked and prompts for a new password
    # - password_reset_complete shows a success message for the above
    url(r'^password-reset/$',
            auth_views.password_reset,
            {'template_name': 'password_reset/password_reset.html',
             'email_template_name': 'password_reset/password_reset_email.html',
             'subject_template_name': 'password_reset/password_reset_subject.txt'},
            name="password_reset"),
    url(r'^password-reset/done/$',
            auth_views.password_reset_done,
            {'template_name': 'password_reset/password_reset_done.html'},
            name="password_reset_done"),
    url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
            auth_views.password_reset_confirm,
            {'template_name': 'password_reset/password_reset_confirm.html'},
            name='password_reset_confirm'),
    url(r'^password-reset/complete/$',
            auth_views.password_reset_complete,
            {'template_name': 'password_reset/password_reset_complete.html'},
            name="password_reset_complete"),
    #url('^password-change/', auth_views.password_change,
    #    {'post_change_redirect':reverse_lazy('userlogout'), 'template_name':'accountmanagement.html'},
    #    name="passwordchange"),
]

urls.py for project:

urlpatterns = [
    url(r'^$', LandingPage.as_view(), name="homepage"),
    url(r'^my_app/', include('my_app.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

When I visit localhost:8000/my_app/password-reset/ I get my landingpage.html template instead. The dev server output definitely shows a single GET to /my_app/password-reset/, and I've checked all the project's apps' urls.py; the password-reset url isn't duplicated anywhere else.

I've even commented out that app's TEMPLATES directory in my settings file to try to force a TemplateDoesNotExist, and it does nothing - the password-reset view seems to be ignoring the template_name parameter that I pass in the url config file.

I'm stumped. What could cause this?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Just realised that someone else was working on the codebase. reset_password.html was supposed to {% extends "landingpage.html" %} but the frontend engineer rebuilt landingpage.html without the {% block content %} needed for it to be extendable, hence it just showed the landing page template.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda