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?
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.