2

I am trying to use django's inbuilt urls and views for the user authentication but have customized the html files, e.g. login.html registration/password_reset_form.html

I have imported the urls in my url.py

from django.contrib.auth import urls

and in the urlpatterns

url(r'^account/', include('django.contrib.auth.urls')),

in my views.py

from django.contrib.auth.views import *

(with no other view functions to handle the auth process)

in my registration file there are login.html password_reset_form.html password_reset_done.html...

The problem is that the django view login is recognizing my login.html under the registration file as it shows my customized log in page, but for the url account/password_reset/ the django password_reset view function cannot recongnize my password_reset_form.html, instead, it is using the django password_reset page.

Can anyone tell me where the problem could be and how to solve this problem? I have read the django auth codes here https://github.com/django/django/tree/master/django/contrib/auth and really want to use the django inbuilt url/views to make my project standard. Thank you very much.

4

1 回答 1

1

The filesystem template loader uses settings.TEMPLATE_DIRS to specify where to look for templates, so make sure that you've added the directory containing registration/ to it (and that you've enabled the filesystem loader).

于 2013-07-01T02:55:37.343 回答