python2.7 - django 無(wú)法連接redis
問(wèn)題描述
django想用redis做緩存。無(wú)法連接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)
求大神指導(dǎo),為何連接不上啊
問(wèn)題解答
回答1:’LOCARION’ is this a typo?
回答2:’LOCATION’: ’redis://127.0.0.1:6379/4’,
相關(guān)文章:
1. MySQL的聯(lián)合查詢[union]有什么實(shí)際的用處2. 怎么能做出標(biāo)簽切換頁(yè)的效果,(文字內(nèi)容隨動(dòng))3. mysql - sql 左連接結(jié)果union右連接結(jié)果,導(dǎo)致重復(fù)性計(jì)算怎么解決?4. 從git上下載的laravel項(xiàng)目不能用5. 數(shù)組排序,并把排序后的值存入到新數(shù)組中6. php多任務(wù)倒計(jì)時(shí)求助7. mysql 遠(yuǎn)程連接出錯(cuò)10060,我已經(jīng)設(shè)置了任意主機(jī)了。。。8. mysql怎么表示兩個(gè)字段的差9. PHP訂單派單系統(tǒng)10. 默認(rèn)輸出類型為json,如何輸出html
