Django - nginx + fastcgi & # 8594; Unhandled exception (after upgrading from Django 1.2.4 to Django 1.3)

I just upgraded from django 1.2.4 to 1.3.

I use nginx in combination with fastcgi and for some reason every time I access the page I get this error:

Unhandled Exception

An unhandled exception was thrown by the application.

Any ideas what could be the problem?

+3
source share
2 answers

To fix this, I added this class (which does practically nothing) in: /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()
+1
source

You need to track the fastcgi error log. There should be more detailed information to me.

+2
source

All Articles