Flask 报错 RuntimeError: The session is unavailable because no secret key was set.

RuntimeError: The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret.

当我们在liunx系统上运行Flask项目的时候,遇到这个错误时:
在这里插入图片描述

解决方法:

网上基本上都是说,在Flask对象app下面设置SECRET_KEY:
加在我项目的启动文件,我能在window10下成功运行项目,在liunx系统上不能成功还是报错
在这里插入图片描述
加在我项目的启动文件下的这里在linux就能成功运行
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45688123/article/details/121250330
今日推荐