Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!