hello friends in new project i use Django4 and i set the "django.core.cache.backends.redis.RedisCache" for the cache but i have the error it say "AttributeError: 'RedisCache' object has no attribute 'ttl'" .it refer to the line of my code that i add it below :
from django.core.cache import cache
def validate_token(token, check_time=True):
if cache.ttl(token) == 0:
return False
try:
data = claim_token(token)
except Exception:
return False
if "type" not in data.keys():
return False
can anyone tell me how i can resolve it ? (i know ttl mean time to live)