gpt4 book ai didi

python - django none 类型对象没有属性状态

转载 作者:太空狗 更新时间:2023-10-30 01:38:51 26 4
gpt4 key购买 nike

我从 Django 得到以下错误:

NoneType object has no attribute status_code

这是日志输出的副本:

Environment:

Request Method: GET
Request URL: http://192.168.2.206:8080/institutes_admin/
Django Version: 1.1.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.markup',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.comments',
'mysite.registration',
'mysite.profiles',
'mysite.epw',
'mysite.remember_me',
'mysite.avatar',
'mysite.django_documents',
'mysite.inlines',
'mysite.blog',
'mysite.forum',
'tagging']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'mysite.remember_me.views.AutoLogout')


Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/utils/decorators.py" in _wrapped_view
56. result = middleware.process_response(request, response)
File "/usr/lib/pymodules/python2.6/django/middleware/cache.py" in process_response
80. if not response.status_code == 200:

Exception Type: AttributeError at /institutes_admin/
Exception Value: 'NoneType' object has no attribute 'status_code'

最佳答案

服务于 institutes_admin URL 的 View 没有返回响应,所以中间件在尝试缓存它时快要死了。您需要发布该 View 的代码 - 请在此处进行,而不是在单独的粘贴站点上进行。

关于python - django none 类型对象没有属性状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4222925/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com