有没有一种方法可以使用django验证用户和密码?

时间:2018-11-20 03:02:52

标签: django django-forms django-authentication

可以在Django中验证用户名和密码吗?我所能找到的是 https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html
这只是使用用户名身份验证

2 个答案:

答案 0 :(得分:0)

默认情况下,Django使用username验证用户身份。如果要使用电子邮件而不是用户名对用户进行身份验证,则可以查看本教程。

Authenticate user with email instead of username

答案 1 :(得分:0)

看一看allauth可能值得您花些时间。 https://django-allauth.readthedocs.io/en/latest/overview.html