python2.7 - When using django-redis, the data in redis cannot be accessed after connecting?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 13:18:41
0
1
909

Using dango-redis, when using redis for caching, the data in redis cannot be accessed
Configuration items:

Data in redis

function in views:

Ask God for guidance

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
迷茫

The reason is predicted to be that you directly use django cache to perform the get operation. The get function will do some conversion on the key internally. As for the specifics, you still need to test and track it yourself

1 When getting the value, the key will be converted internally, that is

key = self.make_key(key, version=version)

That is, if the key is test2, the converted key is :1:test2. When you use the converted key to obtain it from your cache service, it will be empty

2 You can use ipython to set a value and then test whether get is ok

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!