淋雨的小蚂蚁的博客在使用if request.user.is_authenticated():出现错误,因为我是用的是django3.2,is_authenticated在django3.1版本以上都是属性,不是方法。改为if request.user.is_authenticated即可。 if request.user.is_...
avenue轩的博客报错: if request.user.is_authenticated(): TypeError: ‘bool’ object is not callable 在用户校验的时候报的错。错误提示bool类型的不可以调用。 这块是由于因为 is_authenticated是属性而不是方法...
i see the future的博客解决方法:if not request.user.is_authenticated判断用户是否有效,如果无效则不启动下列方法,如update_should_review(request)。 def home(request): '''进入主页''' # 如果是陌生访客,就退出;否则继续 if ...