def __init__(
        self,
        cache_timeout=settings.CACHE_MIDDLEWARE_SECONDS,
        key_prefix=settings.CACHE_MIDDLEWARE_KEY_PREFIX,
        cache_anonymous_only=getattr(
            settings,
            'CACHE_MIDDLEWARE_ANONYMOUS_ONLY',
            False
        ),
        patch_headers=False,
        post_process_response=None,
        post_process_response_always=None,
        only_get_keys=None,
        forget_get_keys=None,
        remember_all_urls=getattr(
            settings,
            'FANCY_REMEMBER_ALL_URLS',
            False
        ),
        remember_stats_all_urls=getattr(
            settings,
            'FANCY_REMEMBER_STATS_ALL_URLS',
            False
        ),
        **kwargs
    ):
        self.patch_headers = patch_headers
        self.cache_timeout = cache_timeout
        self.key_prefix = key_prefix
        self.cache_anonymous_only = cache_anonymous_only
        self.post_process_response = post_process_response
        self.post_process_response_always = post_process_response_always
        if isinstance(only_get_keys, string_types):
            only_get_keys = [only_get_keys]
        self.only_get_keys = only_get_keys
        if isinstance(forget_get_keys, string_types):
            forget_get_keys = [forget_get_keys]
        self.forget_get_keys = forget_get_keys
        self.remember_all_urls = remember_all_urls
        self.remember_stats_all_urls = remember_stats_all_urls

        try:
            cache_alias = kwargs['cache_alias']
            if cache_alias is None:
                cache_alias = DEFAULT_CACHE_ALIAS
        except __HOLE__:
            cache_alias = settings.CACHE_MIDDLEWARE_ALIAS

        self.cache_alias = cache_alias
dataset/ETHPy150Open peterbe/django-fancy-cache/fancy_cache/middleware.py/CacheMiddleware.__init__