__init__.py 文件源码

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

项目:tissuelab 作者: VirtualPlants 项目源码 文件源码
def parse_backend_conf(backend, **kwargs):
    """
    Helper function to parse the backend configuration
    that doesn't use the URI notation.
    """
    # Try to get the CACHES entry for the given backend name first
    conf = settings.CACHES.get(backend, None)
    if conf is not None:
        args = conf.copy()
        args.update(kwargs)
        backend = args.pop('BACKEND')
        location = args.pop('LOCATION', '')
        return backend, location, args
    else:
        try:
            # Trying to import the given backend, in case it's a dotted path
            backend_cls = import_by_path(backend)
        except ImproperlyConfigured as e:
            raise InvalidCacheBackendError("Could not find backend '%s': %s" % (
                backend, e))
        location = kwargs.pop('LOCATION', '')
        return backend, location, kwargs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号