zoukankan      html  css  js  c++  java
  • FLASK爬坑笔记

    转自:http://www.cnblogs.com/teuton/p/6654891.html

    • BUG1

      ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
      .format(x=modname), ExtDeprecationWarning

      解决办法:
      此错误信息出现在对 flask 进行拓展时导入包的方式上

      错误:from flask.ext.script import Manager

      正确:from flask_script import Manager

    • BUG2

      TypeError: 'bool' object is not callable

      解决办法
      flask_login 0.3之后将authenticated从函数更改为属性
      把g.user.is_authenticated() 修改为g.user.is_authenticated

    • BUG3

      第三方模块登录(OPenid)登录出错

      Login requested for OpenID="https://me.yahoo.com", remember_me=False
      解决办法暂时没找到 改用本地登录

      原因:获得用户时出错

    • BUG4
      **IndentationError: unexpected indent **

      原因:可能是tab和空格没对齐的问题,需要检查下tab和空格

    +BUG5

    TypeError: Unicode-objects must be encoded before hashing

    原因:未进行编码

    • BUG6

      jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'author'

      原因:user中post传参错误

    • BUG7
      sqlalchemy.exc.IntegrityError

      原因:数据库中的用户名不唯一

    思考:为防止数据重复出现,在两个或者多线程/进程进行并行存取数据库时,怎么解决?

      • BUG8
        sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table

        原因:没有创建相应的数据库

  • 相关阅读:
    git
    composer
    laravel saas
    算法模板-01背包
    GMP-C/C++(大数库)使用方法
    算法模板-容斥原理
    算法模板-欧拉函数
    算法模板-素数判断/素数筛法
    算法模板-质因数分解
    算法模板-快速幂取模
  • 原文地址:https://www.cnblogs.com/gswang/p/7526887.html
Copyright © 2011-2022 走看看