I got the following error when I activate caching: ---------- Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib64/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib64/python2.3/site-packages/django/core/handlers/modpython.py", line 164, in handler return ModPythonHandler()(req) File "/usr/lib64/python2.3/site-packages/django/core/handlers/modpython.py", line 145, in __call__ response = middleware_method(request, response) File "/usr/lib64/python2.3/site-packages/django/middleware/cache.py", line 78, in process_response if request._cache_middleware_set_cache: AttributeError: 'ModPythonRequest' object has no attribute '_cache_middleware_set_cache' ----------
It does not occur on all my pages, but only on a particular set. When I deactivate caching the same pages show up just fine. It also happens when I access a page that does not exist (a bad URL). Normally this would generate a Http404, but when I activate caching the error occurs. The settings I use are the following: #CacheMiddleware settings CACHE_MIDDLEWARE_SECONDS = 60 * 60 * 1 # 1 hour CACHE_MIDDLEWARE_KEY_PREFIX = 'mydjangocache' CACHE_MIDDLEWARE_GZIP = True MIDDLEWARE_CLASSES = ( "django.middleware.common.CommonMiddleware", "django.middleware.cache.CacheMiddleware", ) Anybody any ideas how I can resolve this issue? Thanks.