简体   繁体   English

在Redis会话中保存静态文件(Python flask)

[英]Saving static files in redis session (Python flask)

I'm trying to build a machine learning web app where users can input the parameters and the predictions will be outputted as a .txt file. 我正在尝试构建一个机器学习Web应用程序,用户可以在其中输入参数,并且预测将以.txt文件形式输出。 I'm also trying to use redis sessions as part of the web app so each users' .txt file will be different from each other. 我还尝试将Redis会话用作网络应用程序的一部分,以便每个用户的.txt文件彼此不同。

I'm using 我正在使用

df.to_csv(filename.txt)

to transform my predictions dataframe into a .txt file. 将我的预测数据帧转换为.txt文件。 Is it possible to save this .txt file in a redis session instead of saving it to the directory where the source code lies? 是否可以将这个.txt文件保存在redis会话中,而不是将其保存到源代码所在的目录中?

您需要序列化.txt文件,但我认为我不会将Redis用于此类任务,可能是sqlite或直接在服务器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM