文章詳情頁
python2.7 - django 無法連接redis
瀏覽:95日期:2022-06-25 17:13:09
問題描述
django想用redis做緩存。無法連接redis。
#setting.py中CACHES={ 'default':{'BACKEND': 'django_redis.cache.RedisCache','LOCATION': '127.0.0.1:6379',’OPTIONS’: { #'CLIENT_CLASS': 'redis_cache.client.DefaultClient', 'DB': 0, 'PARSER_CLASS': 'redis.connection.HiredisParser', 'CONNECTION_POOL_CLASS': 'redis.BlockingConnectionPool', 'PICKLE_VERSION': -1 } }}
#views.pydef testCache(request): print cache print dir(cache) mn = cache.get('test2') return HttpResponse(mn)
求大神指導,為何連接不上啊
問題解答
回答1:’LOCARION’ is this a typo?
回答2:’LOCATION’: ’redis://127.0.0.1:6379/4’,
相關文章:
1. html - 微信瀏覽器h5<video>標簽問題2. python - 如何對列表中的列表進行頻率統計?3. node.js - 為什么微信的消息MsgId出現重復了,無法排重了。。4. java - mysql緩存問題5. javascript - 關于Node 、 commonJs、 vue 之間的故事6. android - 像支付寶到位這種點擊marker點擊變大怎么做的7. javascript - 關于ios微信端瀏覽器網頁的一些問題8. python - 如何正則字符串中的所有漢字9. android 微信是如何實現即時更新好友頭像的10. 黑客 - Python模塊安全權限
排行榜
