Skip to content

Commit 15a581d

Browse files
author
Paweł Sacawa
authored
Add: response status to HistoryPanel (#1490)
* Add: response status to HistoryPanel * Doc: update docs/changes.rst
1 parent 9b6aae4 commit 15a581d

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

debug_toolbar/panels/history/panel.py

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def generate_stats(self, request, response):
6868
{
6969
"request_url": request.get_full_path(),
7070
"request_method": request.method,
71+
"status_code": response.status_code,
7172
"data": data,
7273
"time": timezone.now(),
7374
}

debug_toolbar/templates/debug_toolbar/panels/history.html

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<th>{% trans "Method" %}</th>
1111
<th>{% trans "Path" %}</th>
1212
<th>{% trans "Request Variables" %}</th>
13+
<th>{% trans "Status" %}</th>
1314
<th>{% trans "Action" %}</th>
1415
</tr>
1516
</thead>

debug_toolbar/templates/debug_toolbar/panels/history_tr.html

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
</table>
3939
</div>
4040
</td>
41+
<td>
42+
<p>{{ store_context.toolbar.stats.HistoryPanel.status_code|escape }}</p>
43+
</td>
4144
<td class="djdt-actions">
4245
<form method="get" action="{% url 'djdt:history_sidebar' %}">
4346
{{ store_context.form }}

docs/changes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Next version
1010
running with multiple processes.
1111
* Fixed ``RENDER_PANELS`` functionality so that when ``True`` panels are
1212
rendered during the request and not loaded asynchronously.
13+
* HistoryPanel now shows status codes of responses.
1314

1415

1516
3.2.1 (2021-04-14)

0 commit comments

Comments
 (0)