开发者

Django a way to store user-level data

开发者 https://www.devze.com 2023-04-12 01:38 出处:网络
I\'m looking for an efficient way to store some user-level data that do not need to be persistent. For example, I would like to show user a different error message when user encounters the same error

I'm looking for an efficient way to store some user-level data that do not need to be persistent.

For example, I would like to show user a different error message when user encounters the same error more than once. Right now I generate a user-unique key and then add it to the c开发者_如何学Goache system.

I first thought to store it in the user session, but it is stored in database and I don't need it to be stored there. It's ok if this data will be lost on server restart/shutdown.

May be there is a better solution for such cases?


The session is the right place. If you don't want to use the database, then don't use a database session backend.

0

精彩评论

暂无评论...
验证码 换一张
取 消