Skip to content

Instantly share code, notes, and snippets.

View jTiKey's full-sized avatar
🏠
Working from home

Slava jTiKey

🏠
Working from home
View GitHub Profile
@jTiKey
jTiKey / util.py
Last active December 26, 2019 17:18 — forked from relekang/util.py
Expire @cache_page in django >=2.0
from django.core.cache import cache
from django.urls import reverse
from django.http import HttpRequest
from django.utils.cache import get_cache_key
def expire_page_cache(view, args=None):
"""
Removes cache created by cache_page functionality.
Parameters are used as they are in reverse()
"""