{"id":1969,"date":"2022-08-30T15:20:57","date_gmt":"2022-08-30T15:20:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/06\/django-nginxfastcgi-unhandled-exception-after-upgrade-from-django-1-2-4-to-django-1-3-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:20:57","modified_gmt":"2022-08-30T15:20:57","slug":"django-nginxfastcgi-unhandled-exception-after-upgrade-from-django-1-2-4-to-django-1-3-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/django-nginxfastcgi-unhandled-exception-after-upgrade-from-django-1-2-4-to-django-1-3-collection-of-common-programming-errors\/","title":{"rendered":"django &#8211; nginx+fastcgi &#8211;&gt; Unhandled Exception (after upgrade from Django 1.2.4 to Django 1.3)-Collection of common programming errors"},"content":{"rendered":"<p>To fix it I added this class (that practically doesn&#8217;t do anything) in the : <code>\/usr\/local\/lib\/python2.6\/dist-packages\/django\/middleware\/http.py<\/code><\/p>\n<pre><code>class SetRemoteAddrFromForwardedFor(object):\n    \"\"\"\n    This middleware has been removed; see the Django 1.1 release notes for\n    details.\n\n    It previously set REMOTE_ADDR based on HTTP_X_FORWARDED_FOR. However, after\n    investiagtion, it turns out this is impossible to do in a general manner:\n    different proxies treat the X-Forwarded-For header differently. Thus, a\n    built-in middleware can lead to application-level security problems, and so\n    this was removed in Django 1.1\n\n    \"\"\"\n    def __init__(self):\n        import warnings\n        warnings.warn(\"SetRemoteAddrFromForwardedFor has been removed. \"\n                      \"See the Django 1.1 release notes for details.\",\n                      category=DeprecationWarning)\n        raise MiddlewareNotUsed()\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-12-06 14:31:37. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>To fix it I added this class (that practically doesn&#8217;t do anything) in the : \/usr\/local\/lib\/python2.6\/dist-packages\/django\/middleware\/http.py class SetRemoteAddrFromForwardedFor(object): &#8220;&#8221;&#8221; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1969","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1969"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1969\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}