我刚从django 1.2.4升级到1.3。
我正在将 nginx 与 fastcgi 结合使用,出于某种原因,每当我访问某个网页时,都会收到此错误:
Unhandled Exception
An unhandled exception was thrown by the application.
任何想法可能是什么问题?
答案 0 :(得分:2)
您需要跟踪fastcgi错误日志。那里应该有更详细的信息。
答案 1 :(得分:1)
为了解决这个问题,我在:/usr/local/lib/python2.6/dist-packages/django/middleware/http.py
class SetRemoteAddrFromForwardedFor(object):
"""
This middleware has been removed; see the Django 1.1 release notes for
details.
It previously set REMOTE_ADDR based on HTTP_X_FORWARDED_FOR. However, after
investiagtion, it turns out this is impossible to do in a general manner:
different proxies treat the X-Forwarded-For header differently. Thus, a
built-in middleware can lead to application-level security problems, and so
this was removed in Django 1.1
"""
def __init__(self):
import warnings
warnings.warn("SetRemoteAddrFromForwardedFor has been removed. "
"See the Django 1.1 release notes for details.",
category=DeprecationWarning)
raise MiddlewareNotUsed()