﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
132	REMOTE_ADDR not in WSGI-environ	anonymous	Adrian Holovaty	"The WSGI-spec does not promise the presence of 'REMOTE_ADDR' in environ, but DjangoContext reads it unconditionally when checking if it is in INTERNAL_IPS.

Here is a short patch to fix this, by using .get instead of [].

{{{
Index: django/core/extensions.py
===================================================================
--- django/core/extensions.py   (revision 247)
+++ django/core/extensions.py   (working copy)
@@ -13,7 +13,7 @@
         self['user'] = request.user
         self['messages'] = request.user.get_and_delete_messages()
         self['perms'] = PermWrapper(request.user)
-        if DEBUG and request.META['REMOTE_ADDR'] in INTERNAL_IPS:
+        if DEBUG and request.META.get('REMOTE_ADDR') in INTERNAL_IPS:
             self['debug'] = True
             from django.core import db
             self['sql_queries'] = db.db.queries
}}}"	defect	closed	Core (Other)		normal	fixed	wsgi		Unreviewed	0	0	0	0	0	0
