Django是否附带了与django.contrib.auth模块一起使用的身份验证模板? [英] Does Django ship with the authentication templates for use with the django.contrib.auth module?

查看:144
本文介绍了Django是否附带了与django.contrib.auth模块一起使用的身份验证模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现一些在测试目录下,但我不知道他们是否是正确的。

I found some under the tests directory but I'm not sure if they are the right ones.

通过身份验证模板我的意思是 login.htm password_reset.htm 等。

By authentication templates I mean login.htm, password_reset.htm, etc.

一些模板可以在以下位置找到: http://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/

Some of the templates can be found at: http://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/

推荐答案

不,它会在您的模板文件夹中的注册目录中查找这些模板。

No, it looks for those templates in a "registration" directory within your templates folder.

从文档:


默认情况下,您有责任在登录/ login.html的模板中提供登录表单。

It's your responsibility to provide the login form in a template called registration/login.html by default.

密码重置可选参数:


template_name :用于显示密码重置表单的模板的全名。如果不提供,这将默认为 registration / password_reset_form.html

template_name: The full name of a template to use for displaying the password reset form. This will default to registration/password_reset_form.html if not supplied.


文件:登录 password_reset

这篇关于Django是否附带了与django.contrib.auth模块一起使用的身份验证模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆