django自带的用户验证是验证username和password,如何自定义验证功能,让mobil也能作为账户名登录?
users.views.pyfromdjango.contrib.auth.backendsimportModelBackendfromdjango.db.modelsimportQclassCustomAuth(ModelBackend):defauthenticate(self,request,username=None,password=None,**kwargs):try:user=Use