TypeError: 'bool' object is not callable

来源:互联网 发布:聊城行知中学 编辑:程序博客网 时间:2024/06/05 03:28

因为   is_authenticated是属性所以有如下做法

models中的三个   
 def is_authenticated(self):
        return True

    def is_active(self):
        return True

    def is_anonymous(self):
        return False
改成
    dis_authenticated = True

    is_active = True

    is_anonymous = False

然后将其他地方的is_authenticated()括号去掉,完美解决