|
@@ -1,14 +1,15 @@
|
|
|
#!/usr/bin/env python3
|
|
#!/usr/bin/env python3
|
|
|
# -*- coding:utf-8 -*-
|
|
# -*- coding:utf-8 -*-
|
|
|
import redis
|
|
import redis
|
|
|
|
|
+from config import database_config
|
|
|
|
|
|
|
|
|
|
|
|
|
class Redis(object):
|
|
class Redis(object):
|
|
|
def __init__(self):
|
|
def __init__(self):
|
|
|
- self.redis = redis.StrictRedis(host='r-t4nb4n9i8je7u6ogk1pd.redis.singapore.rds.aliyuncs.com',
|
|
|
|
|
- port=5000,
|
|
|
|
|
- password='gHmNkVBd88sZybj',
|
|
|
|
|
- db=10,
|
|
|
|
|
|
|
+ self.redis = redis.StrictRedis(host=database_config.REDIS_HOST,
|
|
|
|
|
+ port=database_config.REDIS_PORT,
|
|
|
|
|
+ password=database_config.REDIS_PASSWD,
|
|
|
|
|
+ db=database_config.REDIS_DB,
|
|
|
decode_responses=True)
|
|
decode_responses=True)
|
|
|
|
|
|
|
|
|
|
|