[Django] #31794: NotImplementedError: subclasses of BaseCache must provide a touch() method

7 views
Skip to first unread message

Django

unread,
Jul 15, 2020, 11:29:50 PM7/15/20
to django-...@googlegroups.com
#31794: NotImplementedError: subclasses of BaseCache must provide a touch() method
-----------------------------------------------+------------------------
Reporter: Robin | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Cache system) | Version: 3.1
Severity: Normal | Keywords: cache
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
I am getting the following exception when trying to call cache.touch()
method.


{{{
File "PROJECT_PATH/.venv/lib/python3.8/site-
packages/django/core/cache/backends/base.py", line 135, in touch
raise NotImplementedError('subclasses of BaseCache must provide a
touch() method')
NotImplementedError: subclasses of BaseCache must provide a touch() method
}}}

{{{
# settings.py

CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "unique-snowflake",
}
}

#tasks.py
from django.core.cache import cache


def test():
...
cache.touch("session_cache_ffff0000", 1500)
...
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31794>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 16, 2020, 12:19:41 AM7/16/20
to django-...@googlegroups.com
#31794: NotImplementedError: subclasses of BaseCache must provide a touch() method
-------------------------------------+-------------------------------------
Reporter: Robin | Owner: nobody
Type: Uncategorized | Status: closed

Component: Core (Cache system) | Version: 3.1
Severity: Normal | Resolution:
| worksforme

Keywords: cache | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* resolution: => worksforme


Comment:

`touch()` works for me with `LocMemCache`. I cannot reproduce this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/31794#comment:1>

Reply all
Reply to author
Forward
0 new messages