cache.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:FlaskService 作者: b96705008 项目源码 文件源码
def configure_cache(app, config):
    cache_config = {
        'CACHE_TYPE': config.get('cache', 'type')
    }

    if cache_config['CACHE_TYPE'] == 'redis':
        cache_config['CACHE_REDIS_HOST'] = config.get('redis', 'host')
        cache_config['CACHE_REDIS_PORT'] = config.getint('redis', 'port')

    cache = Cache(app, config=cache_config)
    return cache
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号