flask渲染模板时报错TypeError: 'UnboundField' object is not callable
渲染模板时,访问页面提示TypeError: 'UnboundField' object is not callable

检查代码,发现实例化表单类是,没有加括号:form = NewNoteForm,加了括号后就解决了form = NewNoteForm()
@app.route('/index')
def index():
form = NewNoteForm
notes = Note.query.all()
return render_template('index.html', notes=notes, form=form)

flask渲染模板时报错TypeError: 'UnboundField' object is not callable的更多相关文章
- 解决Flask和Django的错误“TypeError: 'bool' object is not callable”
跟着欢迎进入Flask大型教程项目!的教程学习Flask,到了重构用户模型的时候,运行脚本后报错: TypeError: 'bool' object is not callable 这是用户模型: c ...
- appium 提示报错“TypeError: 'unicode' object is not callable”的解决方式!
这里提到的这个报错,是小错误且容易经常会犯,有时需要特别注意使用. 目的要求结果:根据某个元素的id值获取到对应id的text值,并且将获取的text值与本身存在的text值做比较,查看text值是否 ...
- pip install 报错 TypeError: 'module' object is not callable
$ pip install filetype Traceback (most recent call last): File "/usr/local/bin/pip2", line ...
- python3 pip报错 TypeError: 'module' object is not callable
使用命令:python -m pip install xx即可,需要在pip前加python -m
- TypeError: 'str' object is not callable
Python报错TypeError: 'str' object is not callable
- python Flask :TypeError: 'dict' object is not callable
flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...
- PHP json_decode object时报错Cannot use object of type stdClass as array
PHP json_decode object时报错Cannot use object of type stdClass as array php再调用json_decode从字符串对象生成json对象 ...
- PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable
环境搭建好后,代码如下: from selenium import webdriverdriver = webdriver.chrome()driver.get("http://www.ba ...
- Ajax上传文件/照片时报错TypeError :Illegal invocation
问题 Ajax上传文件/照片时报错TypeError :Illegal invocation 解决 网上搜索问题,错误原因可能有以下几个,依次检查: 请求类型有误,如post请求,但在后台设置的是ge ...
随机推荐
- Intellij IDEA中修改Maven项目的项目名称
1. 原项目名:votesystem-redis 想要重命名成新项目名:votesystem 2. 我们对此项目名进行Rename 3. 再对此项目所在的目录下进行修改 4. 重新打开项目 若 ...
- h5 中的 section 标签
转自 http://www.studyofnet.com/news/331.html 本文导读:<section> 标签定义文档中的节(section.区段).比如章节.页眉.页脚或文档中 ...
- EOS 开发终极神器-vscode (你绝对找不到的干货)
https://eosfans.io/topics/323 前言:最近一直苦于EOS开发没有好用的IDE,用了很多,试了很多,都让人觉得有些差强人意.于是乎笔者在经过,长时间的查找实践中,终于找到了e ...
- 解决办法: RSA host key for [ip address] has changed and you have requested strict checking.
在服务器重装后想要远程连接服务器,报错如下: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE ...
- IntelliJ IDEA 17 本地LicenseServer激活
注意:此方法适用于Idea v2017.2.x 版本及以前版本. IntelliJ IDEA及破解包下载地址:百度网盘 密码:hlko 一.将IntelliJIDEALicenseServer.e ...
- mysql 延迟添加唯一索引
MySQL [test]> create table tbl_keyword ( -> id int not null auto_increment primary key, -> ...
- 隐藏apache服务器信息
安装完apache一般第一时间都是关闭apache的版本信息,黑客会通过apache暴露出来的信息针对性的入侵,为了服务器的安全这些信息一定要及时关闭. 1.隐藏PHP版本 修改php.ini exp ...
- kdevelp 导入makefile工程
比如upx工程,将upx/src/makefile中makefile改为makefile.am,自用kdevelop导入工程找到makefile.am,生成工程后去掉.am,这样就可以像vs一样调试程 ...
- Tortoisegit和GitHub使用入门
作为一个Code人对于github并不陌生吧,记录下使用说明: gitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名gitHub. 工具: git: ...
- opencv安装终结版
---恢复内容开始--- 1.安装Qt5.9.1 Qt官网址:https://download.qt.io/official_releases/qt/ 根据自己的需要选择版本,这里我选择的是qt-op ...