Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A panel for django-debug-toolbar that allows for viewing of recently sent email.

Project Description

Testing and debugging emails while developing a django app has never been pleasant. Sending emails to a file-based backend requires a user to click through obtusely named files and does not provide a way to preview rendered html. Sending email to a valid mailbox incurs a delay as the email is processed though a mail server,and cutters a developer’s inbox.

The mail panel attempts to address these problems by providing a way to preview emails within the browser.

This mail panel is released under the Apache license. If you like it, please consider contributing!

Special thanks to @ShawnMilo for the code review.


To install the mail panel, first install this package with pip install django-mail-panel. Then add the mail_panel app after debug_toolbar to the INSTALLED_APPS setting:


and add the panel DEBUG_TOOLBAR_PANELS:


If you use the DEBUG_TOOLBAR_PANELS to custom order your panels:


Collect static and you’ll be good to go.

./ collectstatic


After installation, you now need to redirect mail to the mail toolbar. Change your email backend to the following:

EMAIL_BACKEND = 'mail_panel.backend.MailToolbarBackend'

By default, mail toolbar stores messages for one day before removing them from cache. You can change this with the following setting:

MAIL_TOOLBAR_TTL = 86400  # 1 Day


To preview emails sent from your test suite, add the email backend override to your tests with the following: from django.test.utils import override_settings

def test_send_email(self):

The backend works similarly to the standard email backend and code should not need to be reworked when using the MailToolbarBackend.

from django.core import mail

original_outbox = len(mail.outbox)
# Send mail ...
assert(len(mail.outbox) == original_outbox + 1)

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(16.7 kB) Copy SHA256 Hash SHA256
2.7 Wheel Dec 17, 2017
(11.7 kB) Copy SHA256 Hash SHA256
Source Dec 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting