diff --git a/django/views/debug.py b/django/views/debug.py index 4eb95c91d9..482d149d90 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -33,8 +33,8 @@ def technical_500_response(request, exc_type, exc_value, tb): 'pre_context_lineno' : pre_context_lineno, }) tb = tb.tb_next - - # Turn the settings module into a dict, filtering out anything that + + # Turn the settings module into a dict, filtering out anything that # matches HIDDEN_SETTINGS along the way. settings_dict = {} for k in dir(settings): @@ -43,7 +43,7 @@ def technical_500_response(request, exc_type, exc_value, tb): settings_dict[k] = '********************' else: settings_dict[k] = getattr(settings, k) - + t = Template(TECHNICAL_500_TEMPLATE) c = Context({ 'exception_type' : exc_type.__name__, @@ -53,7 +53,7 @@ def technical_500_response(request, exc_type, exc_value, tb): 'request' : request, 'request_protocol' : os.environ.get("HTTPS") == "on" and "https" or "http", 'settings' : settings_dict, - + }) return HttpResponseServerError(t.render(c)) @@ -66,7 +66,7 @@ def technical_404_response(request, exception): tried = exception.args[0]['tried'] except (IndexError, TypeError): tried = [] - + t = Template(TECHNICAL_404_TEMPLATE) c = Context({ 'root_urlconf' : settings.ROOT_URLCONF, @@ -80,7 +80,7 @@ def technical_404_response(request, exception): def _get_lines_from_file(filename, lineno, context_lines): """ - Returns context_lines before and after lineno from file. + Returns context_lines before and after lineno from file. Returns (pre_context_lineno, pre_context, context_line, post_context). """ try: @@ -91,7 +91,7 @@ def _get_lines_from_file(filename, lineno, context_lines): pre_context = [line.strip('\n') for line in source[lower_bound:lineno]] context_line = source[lineno].strip('\n') post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]] - + return lower_bound, pre_context, context_line, post_context except (OSError, IOError): return None, [], None, [] @@ -147,23 +147,23 @@ TECHNICAL_500_TEMPLATE = """