zoukankan      html  css  js  c++  java
  • Flask 上的 AttributeError: 'bool' object has no attribute '__call__'问题

    这基本上是flask-login版本问题

    1.下面这段文字没准能帮到你Posting this here so people can see it, this comes from a change in how UserMixin works in flask-login. I'd tell you to install a specific version of flask-login but...they removed those releases from PyPI.

    So...instead of {{ current_user.is_authenticated() }}, you need to use {{ current_user.is_authenticated }}. Just don't include the parentheses. Yeah, it's an annoying change but, honestly, I think it's probably better code design.

    2.lask-login的版本问题,flask-login2.x是current_user.is_authenticated(),flask-login3.x是current_user.is_authenticated。避免这个问题最好的办法就是使用虚拟环境并在requirement中写明版本号。

    current_user.is_authenticated()基本出现在视图函数(views.py)和模板(templates)里面。

  • 相关阅读:
    随笔
    std::condition_variable(复习)
    随笔
    std::vector<std::vector<> >
    staitc_cast,const_cast....
    复制构造函数
    c++ 临时对象
    复制初始化和直接初始化
    随笔
    Fedora 安装oracle11g 之最简洁方式
  • 原文地址:https://www.cnblogs.com/Hondsome/p/5985013.html
Copyright © 2011-2022 走看看