按照
https://docs.appfog.com/services/redis#redis-vcap 配置的
代码这样写:
os_r=os.getenv("VCAP_SERVICES")
r=redis.Redis(host=os_r['redis-2.2'][0]['credentials']['hostname'], port=os_r['redis-2.2'][0]['credentials']['port'], password=os_r['redis-2.2'][0]['credentials']['password'])
提示错误:
string indices must be integers, not str
port是 int 其他都是 str 没有问题啊