我在目录下找到了一些,tests
但我不确定它们是否正确。
通过身份验证模板,我的意思是login.htm
,password_reset.htm
等。
一些模板可以在以下位置找到:http ://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/
我在目录下找到了一些,tests
但我不确定它们是否正确。
通过身份验证模板,我的意思是login.htm
,password_reset.htm
等。
一些模板可以在以下位置找到:http ://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/
虽然Django 文档明确指出“Django 没有为身份验证视图提供默认模板”,但我发现使用管理模板很简单。只需启用管理应用程序,然后将其添加到 urls.py:
url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'admin/login.html'}),
url('^accounts/', include('django.contrib.auth.urls')),
现在所有的身份验证 url 都可以工作,尽管使用 Django 管理员的外观和感觉。
您可以在django.contrib.admin.templates.registration使用身份验证模板:
logged_out.html
password_change_done.html
password_change_form.html
password_reset_complete.html
password_reset_confirm.html
password_reset_done.html
password_reset_email.html
password_reset_form.html
这些将具有 Django Admin 的外观和感觉,因此我建议对其进行自定义。
通过复制上面 DZPM 提到的位于django.contrib.admin.templates.registration中的模板,并将它们放入您自己的注册应用程序的模板目录中,例如 *your_proj_root/registration/templates/registration/*
重要的!如果您为模板保留相同的确切文件名,则必须记住确保您的django.contrib.admin应用程序行位于您的注册应用程序行下方;否则,它将优先使用django.contrib.admin的注册模板。