magic-removal: changed explicit settings import to qualified settings import in django.core.context_processors

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2006-01-16 15:24:06 +00:00
parent c5e944a7e2
commit e3ecd5eeb4
1 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext. RequestContext.
""" """
from django.conf.settings import DEBUG, INTERNAL_IPS, LANGUAGES, LANGUAGE_CODE from django.conf import settings
def auth(request): def auth(request):
""" """
@ -23,7 +23,7 @@ def auth(request):
def debug(request): def debug(request):
"Returns context variables helpful for debugging." "Returns context variables helpful for debugging."
context_extras = {} context_extras = {}
if DEBUG and request.META.get('REMOTE_ADDR') in INTERNAL_IPS: if settings.DEBUG and request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:
context_extras['debug'] = True context_extras['debug'] = True
from django.db import connection from django.db import connection
context_extras['sql_queries'] = connection.queries context_extras['sql_queries'] = connection.queries
@ -31,11 +31,11 @@ def debug(request):
def i18n(request): def i18n(request):
context_extras = {} context_extras = {}
context_extras['LANGUAGES'] = LANGUAGES context_extras['LANGUAGES'] = settings.LANGUAGES
if hasattr(request, 'LANGUAGE_CODE'): if hasattr(request, 'LANGUAGE_CODE'):
context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE
else: else:
context_extras['LANGUAGE_CODE'] = LANGUAGE_CODE context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE
return context_extras return context_extras
# PermWrapper and PermLookupDict proxy the permissions system into objects that # PermWrapper and PermLookupDict proxy the permissions system into objects that