在学习《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. 【读书笔记】https://source.android.google.cn/devices/bootloader

    https://source.android.google.cn/devices/bootloader 本文主要记录aosp官网关于bootloader的相关资料 Bootloader A bootl ...

  2. CODEFORCES ROUND#624 DIV3

    这次比赛从名字就可以看出非常水,然鹅因为第一次打codeforces不太熟悉操作只来的及做签到题(还错了一次) A,B,C都是签到题考点思维就不写了 D题 https://codeforces.ml/ ...

  3. Elasticsearch之增加和删除索引

    增加索引 利用postMan工具发送restfulAPI添加索引库 请求方式为put代表添加 创建索引index时映射mapping 请求URL: 使用put发送http://localhost:92 ...

  4. Git操作:绑定上传已存在的仓库到Github

    之前使用github都是创建一个全新的仓库,然后clone下来用,但如果我已经有一个正在使用的仓库,想要绑定上传已存在的仓库到github,怎么做呢?其实在github创建仓库的时候会提示: …or ...

  5. linux | 一次网卡故障处理

    问题 在centos7系统中,设置ifcfg-eth*文件时,总会纠结NAME和DEVICE到底写哪个或哪个真实生效.这里实例演示下 这是网卡ifcfg-eth4配置文件.没写DEVICE,用的NAM ...

  6. [CF1311B] WeirdSort

    Solution 按照 \(p[i]\) 进行分段,如果某个 \(k\) 不存在 \(p[i]=k\),那么就把 \(i,i+1\) 分割开 处理出每一段的左端点和右端点 进而处理出每段的最小值和最大 ...

  7. H5_0021:判断平台和微信

    1,跳网站: <script>eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c ...

  8. 刷题78. Subsets

    一.题目说明 题目78. Subsets,给一列整数,求所有可能的子集.题目难度是Medium! 二.我的解答 这个题目,前面做过一个类似的,相当于求闭包: 刷题22. Generate Parent ...

  9. 使用Docker镜像安装saltshaker

    要求 Saltstack < 2019 Python >= 3.6 Mysql >= 5.7.8 (支持Json的Mysql都可以) Redis(无版本要求) RabbitMQ (无 ...

  10. javaweb 使用页面模板CSS或者Js修改失效的解决办法(Tomcat缓存问题)

    原因是:浏览器的自动缓存机制导致的. 浏览器会自动缓存静态文件以加快访问速度,但是这导致了他不会再从服务器端接收静态文档了,这就导致我在idea里面改的css和js文档,浏览器根本没下载下来. 所以解 ...