Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
setup preliminary tasks panel logic
  • Loading branch information
Chiemezuo committed Nov 26, 2025
commit 16efb32b8871d2b0a0001758a216ed60a2695372
15 changes: 15 additions & 0 deletions debug_toolbar/panels/tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.utils.translation import gettext_lazy as _

from debug_toolbar.panels import Panel


class TasksPanel(Panel):
"""
Panel that displays Django tasks queued or executed during the
processing of the request.
"""

title = _("Tasks")
template = "debug_toolbar/panels/tasks.html"

is_async = True
1 change: 1 addition & 0 deletions debug_toolbar/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def get_config():
"debug_toolbar.panels.cache.CachePanel",
"debug_toolbar.panels.signals.SignalsPanel",
"debug_toolbar.panels.community.CommunityPanel",
"debug_toolbar.panels.tasks.TasksPanel",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tim-schilling I wonder if it would make sense to check for the Django version here, and only include it if its on a Django version that supports the tasks?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, but it's possible someone installs django-tasks in <6.0 version.

"debug_toolbar.panels.redirects.RedirectsPanel",
"debug_toolbar.panels.profiling.ProfilingPanel",
]
Expand Down
14 changes: 14 additions & 0 deletions debug_toolbar/templates/debug_toolbar/panels/tasks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<table>
<thead>
<tr>
<th>Task Info</th>
Comment thread
Chiemezuo marked this conversation as resolved.
Outdated
</tr>
</thead>
<tbody>
{% for task in tasks %}
<tr>
<td>{{ task }}</td>
</tr>
{% endfor %}
</tbody>
</table>