简体   繁体   English

在瓶子框架(python)中使用 session

[英]using session in bottle framework(python)

I am using bottle(python) framework to fetch data from mongodb and push to grafana.But my problem is it is fetching all the data on each request everytime.So I want to remember the timestamp or id of the last data fetched, so next time it will fetch the new data from the last timestamp or id onwards.can it be done using sessions我正在使用瓶子(python)框架从 mongodb 获取数据并推送到 grafana。但我的问题是它每次都获取每个请求的所有数据。所以我想记住最后一次获取数据的时间戳或 id,所以接下来它将从最后一个时间戳或 id 开始获取新数据的时间。可以使用会话完成吗

Yes, You can do it using session and middleware(using encryption).是的,您可以使用 session 和中间件(使用加密)来做到这一点。

Please refer to the below URL.请参考下面的 URL。

Bottle.py session with Beaker Bottle.py session 带烧杯

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

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