gpt4 book ai didi

python - 类型错误 : set_cookie() got an unexpected keyword argument 'samesite' (flask)

转载 作者:行者123 更新时间:2023-11-28 18:05:35 29 4
gpt4 key购买 nike

我尝试运行一些提供用户管理和身份验证/登录的 flask 扩展,例如 flask-admin。问题是,每当我尝试运行将运行一个简单的用户登录/注册页面然后单击登录或注册按钮的示例之一时,我总是会收到以下错误:

TypeError: set_cookie() got an unexpected keyword argument 'samesite'

完整的Python报错日志为:

Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1816, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1833, in finalize_request
response = self.process_response(response)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 2114, in process_response
self.session_interface.save_session(self, ctx.session, response)
File "/usr/lib64/python2.7/site-packages/flask/sessions.py", line 384, in save_session
samesite=samesite

我环顾四周,但找不到任何解决方案。我使用的不同组件的版本是否不匹配?非常感谢任何帮助。

最佳答案

我升级到:

Flask>=1.0.2
Flask-Login==0.4.1
Werkzeug==0.14.1

错误消失了。我怀疑这是旧 Werkzeug 的问题

关于python - 类型错误 : set_cookie() got an unexpected keyword argument 'samesite' (flask),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53603025/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com