文章内容
2018/9/26 15:06:54,作 者: 黄兵
has been renamed to "CSRFProtect" and will be removed in 1.0.
最近由于项目需要,页面上有多个提交表单,多可csrf会报错,所以修改了使用方式,具体参考这里:flask 多个form.csrf_token如何处理
但是在使用Flask_WTF.csrf的时候如下提示:
FlaskWTFDeprecationWarning: "flask_wtf.CsrfProtect" has been renamed to "CSRFProtect" and will be removed in 1.0.
csrf = CsrfProtect()
flask_wtf.CsrfProtect
将会在1.0版本中淘汰,所以不建议这么写。
解决方案:
原来写法:
from flask_wtf.csrf import CsrfProtect csrf = CsrfProtect()
修改之后:
from flask_wtf.csrf import CSRFProtect csrf = CSRFProtect()
这个警告消失,问题解决。
有什么问题下面交流。
其它相关推荐:
2、Could not build url for endpoint 'xxx'. Did you forget to specify values ['xxx']?
黄兵个人博客原创。
转载请注明出处:黄兵个人博客 - has been renamed to "CSRFProtect" and will be removed in 1.0.
月球上的坑又大又浅,最后竟然自己平掉了……
SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future
SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future
评论列表