在学习《Flask Web开发----基于Python的Web应用开发实战》的过程中,调试程序,如下图,运行报错:

AttributeError: 'SQLAlchemy' object has no attribute 'Foreignkey'

原因:是关键字Foreignkey里的字母k应该是大写,错写成小写字母了

解决办法,改成ForeignKey即可

role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))

AttributeError: 'SQLAlchemy' object has no attribute 'Foreignkey'的更多相关文章

  1. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  2. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  3. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  4. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  5. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

  6. python3 AttributeError: 'NoneType' object has no attribute 'split'

    from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...

  7. 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...

  8. AttributeError: 'module' object has no attribute 'Thread'

    $ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last):  File "th ...

  9. 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

随机推荐

  1. 《Git 从入门到体系》- 写给自己的话

    我听过的对我很有冲击力的观点是:知识不成体系就是垃圾.这个观点不一定对,但是却是给我的冲击很大. 我记得以前在咖啡馆和一个博士医生聊天,他提出了这个观点:知识不成体系就是垃圾.听了这个观点我很想反驳他 ...

  2. (好题)POJ3057

    二分+二分图匹配+BFS 题意: 墙壁“X”,空区域(都是人)“.”, 门“D”. 人向门移动通过时视为逃脱,门每秒能出去一个人,人可以上下左右移动,墙阻止移动. 求最优移动方案下,最后一个人逃脱的最 ...

  3. 常用类String的总结

    /* String:字符串,使用一对""引起来表示. 1.String声明为final的,不可被继承 2.String实现了Serializable接口:表示字符串是支持序列化的. ...

  4. 2python脚本在window编辑后linux不能执行的问题

    参考简书博主天道酬勤abcd python脚本在windows编辑后,在linux下执行提示 /usr/bin/python^M: bad interpreter: No such file or d ...

  5. TCP/IP详解阅读记录----第一章 概述

    1.TCP/IP协议族中不同层次的协议 2.五类互联网地址 3.各类IP地址范围 4.数据进入协议栈时的封装过程 5.以太网数据帧的分用过程

  6. npm ERR! Failed at the node-sass@4.13.0 postinstall script

    node-sass 的数据源没设置 npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass 重新 npm in ...

  7. Expert C Programming(C专家编程) 读书笔记

    目录 几个比较奇葩的指针赋值 int (* fun())() int (* foo())[] int (*foo[])() const 关键词的意义是什么? char const (*next )() ...

  8. java如何在静态方法中访问类的实例成员

    类的静态方法是不能直接访问实例的成员的,它只能访问同类的静态成员.访问实例的成员的话,可以参考一下这个方法,那就是把静态方法的参数设置为类的实例,这样通过参数传递的方式就可以访问实例的成员了,例子如下 ...

  9. sqli-labs less-13 --> less-14

    Less-13(报错盲注) 1.判断是否存在注入点 输入admin’时,出现如下报错信息,经过分析,存在注入点,且注入方式为:(‘’) 执行uname=admin')#&passwd=& ...

  10. 如何在php7.2/php7.3中安装mcrypt扩展?

    mcrypt 是php里面重要的加密支持扩展库,linux环境下该库在默认情况下不开启.window环境下,PHP>=5.3,默认开启mcrypt扩展.mcrypt扩展是mcrypt加密库的接口 ...