默认情况下,django使用用户名对用户进行身份验证。如果您想用电子邮件而不是用户名来验证用户,可以查看本教程。 Authenticate user with email instead of username