问题描述
Django的用户验证系统()与用户合作非常有帮助。但是,该文档谈到密码重置表单,并使它看起来像它用户登录/注销一样照顾它。
Django's User Authentication system ( http://docs.djangoproject.com/en/dev/topics/auth/ ) is incredibly helpful in working with users. However, the documentation talks about password reset forms and makes it seem like it takes care of it the same way it does user login/logout.
登录和注销的默认URL为
The default URL for login and logout is
/ accounts / login / / accounts / logout
/accounts/login/ & /accounts/logout
是否已经有默认值更改密码,还是必须构建该功能?
Are there already defaults for changing the password, or do I have to build that functionality?
推荐答案
如果您查看,您可以看到定义的默认视图。这将是登录
,注销
, password_change
和 password_reset
。
所以你可以将它们挂在你的urlconf中:
So you can just hook them up in your urlconf:
url('^accounts/', include('django.contrib.auth.urls')),
您可能想要自定义这些视图(不同的表单或模板),在我看来您将重新定义这些网址。但是这是一个很好的起点。
As you probably want to customize those views (different form or template), in my opinion you will redefine these urls anyway. But it's a good starting point nevertheless.
这篇关于Django用户验证系统的默认URL是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!