#5920: Error AttributeError: 'function' object has no attribute 'status_code' in
6668 version
------------------------+---------------------------------------------------
Reporter: aaloy | Owner: nobody
Status: reopened | Component: Cache system
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
------------------------+---------------------------------------------------
Changes (by MihaiD):
* status: closed => reopened
* resolution: invalid =>
* component: Uncategorized => Cache system
Comment:
This still doesn't seem to work in the svn trunk. I get the following
error:
Traceback (most recent call last):
File "G:\Python25\lib\site-packages\django\core\servers\basehttp.py",
line 277, in run
self.result = application(self.environ, self.start_response)
File "G:\Python25\lib\site-packages\django\core\servers\basehttp.py",
line 631, in __call__
return self.application(environ, start_response)
File "G:\Python25\lib\site-packages\django\core\handlers\wsgi.py", line
209, in __call__
response = middleware_method(request, response)
File "G:\Python25\lib\site-packages\django\middleware\common.py", line
90, in process_response
if response.status_code == 404:
AttributeError: 'function' object has no attribute 'status_code'
I use cache_page in urls.py. Using @cache_page in views seems to work
though (or at least no errors were generated).
I have the following middleware set:
MIDDLEWARE_CLASSES = (
'django.middleware.cache.CacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)
I couldn't determine if CacheMiddleware was needed for individual views or
not so I've tested with and without it, with the same result.
--
Ticket URL: <
http://code.djangoproject.com/ticket/5920#comment:4>