flask:Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
程序员文章站
2024-02-01 21:47:04
...
写flask项目时遇到问题:
Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
500,服务器报错,网上找了很多解决方案都不对,最后发现是代码使用session时报错。
session['uid'] = user_info.id
用户登录时需要保存用户的id,加密时需要secret_key,需要在setting配置中注明,但是我没有添加,所以一直提示500错误。
最后在setting中添加:
SECRET_KEY = '123zy'
就不报错了!
使用session存储复杂的信息不方便,推荐使用cookie!
推荐阅读
-
Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
-
flask:Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
-
Failed to load resource the server responded with a status of 413 (Request Entity Too Large)
-
Failed to load resource: the server responded with a status of 404 (Not Found)
-
上传图片报错-Failed to load resource:the server responded with a status of 413(Request Entity Too Large)
-
Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)【上传图片】
-
【Nginx】Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
-
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
-
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
-
Failed to load resource:the server responded with a status 413 (Request Entity Too Large)