用户登陆的时候 注册对象auth.login(request,当前登陆人对象) if 获取 request.user 是否为空 登陆成功 优点:可用中间件 校验 ,可全局用 转载于:https://www.cnblogs.com/apollo1616/articles/10049063.html