diff --git a/django/views/debug.py b/django/views/debug.py index aa0a93b863..6d1b0d0e6c 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -100,13 +100,13 @@ def technical_500_response(request, exc_type, exc_value, tb): 'tb': tb, 'filename': filename, 'function': function, - 'lineno': lineno, + 'lineno': lineno + 1, 'vars': tb.tb_frame.f_locals.items(), 'id': id(tb), 'pre_context': pre_context, 'context_line': context_line, 'post_context': post_context, - 'pre_context_lineno': pre_context_lineno, + 'pre_context_lineno': pre_context_lineno + 1, }) tb = tb.tb_next @@ -360,11 +360,11 @@ TECHNICAL_500_TEMPLATE = """ {% if frame.context_line %}
{% if frame.pre_context %} -
    {% for line in frame.pre_context %}
  1. {{ line|escape }}
  2. {% endfor %}
+
    {% for line in frame.pre_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %} -
  1. {{ frame.context_line|escape }} ...
+
  1. {{ frame.context_line|escape }} ...
{% if frame.post_context %} -
    {% for line in frame.post_context %}
  1. {{ line|escape }}
  2. {% endfor %}
+
    {% for line in frame.post_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %}
{% endif %} @@ -404,7 +404,7 @@ Traceback (most recent call last):
{% for frame in frames %} File "{{ frame.filename }}" in {{ frame.function }}
{% if frame.context_line %} -   {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }}
+   {{ frame.lineno }}. {{ frame.context_line|escape }}
{% endif %} {% endfor %}
  {{ exception_type }} at {{ request.path }}