Skip to content

Commit 179cc20

Browse files
committed
Adds mail panel to toolbar by default
1 parent dd9e8fb commit 179cc20

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
* 4.0.2 Mail panel is added by default to the debug toolbar.
4+
* 4.0.0 Adds support for Django 4.0
35
* 3.2.4 Adds tab to view raw message. Added X-Headers to header. (Thanks @benspaulding)
46
* 3.2.1 Local timezone is now used to store messages. (Thanks @jensenbox)
57
* 3.2 Adds ability to resize panels and clear messages. (Thanks @jensenbox)

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,21 @@ If you use the `DEBUG_TOOLBAR_PANELS` to custom order your panels:
6969

7070
```python
7171
DEBUG_TOOLBAR_PANELS = [
72-
'debug_toolbar.panels.versions.VersionsPanel',
73-
'debug_toolbar.panels.timer.TimerPanel',
74-
'debug_toolbar.panels.settings.SettingsPanel',
75-
'debug_toolbar.panels.headers.HeadersPanel',
76-
'debug_toolbar.panels.request.RequestPanel',
77-
'debug_toolbar.panels.sql.SQLPanel',
78-
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
79-
'debug_toolbar.panels.templates.TemplatesPanel',
80-
'debug_toolbar.panels.cache.CachePanel',
81-
'debug_toolbar.panels.signals.SignalsPanel',
82-
'debug_toolbar.panels.logging.LoggingPanel',
83-
'debug_toolbar.panels.redirects.RedirectsPanel',
84-
'mail_panel.panels.MailToolbarPanel',
72+
"debug_toolbar.panels.history.HistoryPanel",
73+
"debug_toolbar.panels.versions.VersionsPanel",
74+
"debug_toolbar.panels.timer.TimerPanel",
75+
"debug_toolbar.panels.settings.SettingsPanel",
76+
"debug_toolbar.panels.headers.HeadersPanel",
77+
"debug_toolbar.panels.request.RequestPanel",
78+
"debug_toolbar.panels.sql.SQLPanel",
79+
"debug_toolbar.panels.staticfiles.StaticFilesPanel",
80+
"debug_toolbar.panels.templates.TemplatesPanel",
81+
"debug_toolbar.panels.cache.CachePanel",
82+
"debug_toolbar.panels.signals.SignalsPanel",
83+
"debug_toolbar.panels.logging.LoggingPanel",
84+
"debug_toolbar.panels.redirects.RedirectsPanel",
85+
"debug_toolbar.panels.profiling.ProfilingPanel",
86+
"mail_panel.panels.MailToolbarPanel", # reposition to desired location
8587
]
8688
```
8789

mail_panel/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
__version__ = '4.0.1'
2+
3+
# Monkey patch the PANELS_DEFAULTS to add mail panel
4+
try:
5+
from debug_toolbar import settings
6+
7+
try:
8+
log_index = settings.PANELS_DEFAULTS.index("debug_toolbar.panels.logging.LoggingPanel")
9+
settings.PANELS_DEFAULTS.insert(log_index, 'mail_panel.panels.MailToolbarPanel')
10+
except ValueError:
11+
settings.PANELS_DEFAULTS.append('mail_panel.panels.MailToolbarPanel')
12+
except ImportError:
13+
pass

0 commit comments

Comments
 (0)