在学习《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. centos5,6的GRUB简介

    grub:GRand Unified Bootloader grub 0.x:grub legacy(centos5,6) grub 1.x:grub2(centos7) grub legacy(gr ...

  2. IoU-aware Single-stage Object Detector for Accurate Localization

    网络的结构如下: 采用FPN结构,Backbone是RetinalNet,分成了P3~P7共5个Layer,分别训练不同尺寸的Box.每个Layer对应的Head有2个分支,包括一个单独的分支用来预测 ...

  3. Python模块之Requests

    目录 Requests 模块 常规的get请求 基于ajax的get请求 常规的post请求 基于ajax的post请求 综合项目实战 requests模块高级 requests代理 验证码处理 Re ...

  4. Ubuntu18.04安装mysql并配置远程访问

    1.ssh连接到Ubuntu服务器 默认root用户登陆,如果运行以下命令没有权限请在命令开头加sudo 2.安装mysql apt install mysql-server 3.配置mysql my ...

  5. java循环语句 总结笔记

    1.for 循环语句 语法:for(initialization;condition;iteration) public class A { public static void main(Strin ...

  6. MySQL安装详细步骤(附迅雷下载链接)

    环境:windows10.64bit.mysql 8.0.19 迅雷下载链接8.0版本 https://cdn.mysql.com//Downloads/MySQLInstaller/mysql-in ...

  7. 安装NFS到CentOS(YUM)

    运行环境 系统版本:CentOS Linux release 7.3.1611 软件版本:无 硬件要求:无 安装过程 1.配置YUM源 [root@localhost ~]# rpm -i https ...

  8. header.vue 调用变量,别的组件导入引用,组件方法事例实例

    <template> <div id="header"> <!-- 调用变量 --> <h1>{{ msg }}</h1> ...

  9. Wannafly Winter Camp 2020 Day 5B Bitset Master - 时间倒流

    有 \(n\) 个点的树,给定 \(m\) 次操作,每个点对应一个集合,初态下只有自己. 第 \(i\) 次操作给定参数 \(p_i\),意为把 \(p_i\) 这条边的两个点的集合合并,并分别发配回 ...

  10. bootstrap 兼容 IE8

    在 html 中引用 <!-- bootstrap 兼容 IE8 --> <script src="../../jsapi/js/html5shiv.min.js" ...