Auth Password Change template not working

40 views
Skip to first unread message

naitik gala

unread,
Sep 27, 2017, 7:10:54 AM9/27/17
to Django users
Hi all,

I am trying to add my own designed html to Auth urls.

One way obviously is to create my own view and implement Auth urls for them. Here, I will explicitly mention the html template that i have created. It would be like any other view that we would create.

But, there seems to be an alternate method. We can reuse the views already created in Auth module.

By reference of documentations, I made following steps:

1. created an html template 'myproject/myapp/templates/registration/login.html'
2. updated 'myproject/myproject/urls.py' with following

urlpatterns = [
    url
(r'^admin/', admin.site.urls),
    url
('', include('django.contrib.auth.urls')),
    url
(r'^', include('myapp.urls')),
]

This successfully worked for /login/ i.e. it showed my custom template.

It however now fails if I created for /password_change/ as i created 2 files for that 'myporject/myapp/templates/registration/password_change_form.html' and 'myporject/myapp/templates/registration/password_change_done.html'

Is this a bug or I am missing something? Please help.

Tim Graham

unread,
Sep 30, 2017, 3:00:44 PM9/30/17
to Django users
I'd temporarily remove the built-in template that's being loaded so that TemplateDoesNotExist is raised. The debug page will show the locations that Django searched for the template.

naitik gala

unread,
Oct 3, 2017, 7:53:39 PM10/3/17
to Django users

Yes that method worked. it showed all the physical location where it looked for the template file. Thanks.

Is there a way to configure the order in which django looks for the template files?
Reply all
Reply to author
Forward
0 new messages