TypeError from Django Cache

Refresh . See the “Even Better Solution” section below.

I have me at a standstill. When I invoke the HTML page generated by the Django REST Framework, it works. When I call it second, third, fourth, I get:

[26/Oct/2015 15:14:42]"GET /api/rest/v3/dockets/ HTTP/1.1" 500 92424
Internal Server Error: /api/rest/v3/dockets/
Traceback (most recent call last):
  File "/home/mlissner/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/home/mlissner/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/django/middleware/cache.py", line 134, in process_request
    response = self.cache.get(cache_key, None)
  File "/home/mlissner/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/django/core/cache/backends/locmem.py", line 54, in get
    return pickle.loads(pickled)
TypeError: __new__() takes exactly 3 arguments (2 given)

Unlike 99% of the stacktraces I get from Django, this one doesn't mention my code at all and seems to be just the code of Django itself.

I am using a development server, Django 1.8.7, Django REST Framework 3.2.3, and Python 2.7.

My middleware setup:

MIDDLEWARE_CLASSES = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
]

I only saw this when browsing the Django REST Framework pages. Any ideas?

Things i tried

  • Updating Django, djangorestframework and djangorestframework-filters.
  • CACHE, LocMemCache Redis. , , - FileBasedCache. redis, , DummyCache .

django-redis-cache , , , , . , django-redis ( "PICKLE_VERSION, , " ) . , PICKLE_VERSION 1, .

DRF, , . , , Django.

, . , Django Rest Framework, 3.3.2 ().

+4
2

Django Rest Framework, ​​ 3.3.2.

0
+1

Source: https://habr.com/ru/post/1613267/


All Articles