统一获取 redis 实例的方法
This commit is contained in:
9
utils/cache.py
Normal file
9
utils/cache.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# coding=utf-8
|
||||
import redis
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def get_cache_redis():
|
||||
return redis.Redis(host=settings.REDIS_CACHE["host"],
|
||||
port=settings.REDIS_CACHE["port"],
|
||||
db=settings.REDIS_CACHE["db"])
|
||||
Reference in New Issue
Block a user