Skip to main content

View emails in development without actually sending them.

Project description

View emails in development without actually sending them.


The full documentation is at


Install Django Mail Viewer:

pip install django-mail-viewer

Add it to your INSTALLED_APPS:


Add Django Mail Viewer’s URL patterns:

# You may want to only include this in development environments

# Django 2
urlpatterns = [
    path('', include('django_mail_viewer.urls')),

# Django 1.11
urlpatterns = [
    url(r'^', include('django_mail_viewer.urls')),


EMAIL_BACKEND = 'django_mail_viewer.backends.locmem.EmailBackend'


  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


  • Passthrough backend - store the email for display in the views but also pass to another backend which may actually send
  • Redis backend using Redis specific functionality for cleaner code and less risk of bugs vs the django cache backend
  • Memcached backend
  • File based backend - store each email as its own file
  • Database backend - model to store emails and attachments
  • Other backends? ElasticSearch? MongoDB?
  • Separate views for each of html, plaintext, attachements, etc. to allow for more customization of display?


Tools used in rendering this package:



1.0.0 (2018-04-23)

  • Dropped testing of Django 1.8, 1.9 and 1.10
  • Stopped using assignment_tag in favor of Django 1.9+ simple_tag functionality, definitely breaking Django 1.8
  • Added testing of Django 2.0
  • Updated .editorconfig, added flake8 check, isort, and yapf checks and configs

0.2.0 (2017-08-20)

  • Added stats toxenv to show coverage stats
  • Corrected v0.1.0 release date in history
  • Added setting the Django EMAIL_BACKEND setting to quickstart and usage
  • Added django cache backend
  • Fixed handling of quoted-printable email encoding
  • Dropped testing of Django 1.8, added testing of Django 1.11 and Python 3.6

0.1.0 (2016-12-23)

  • First release on PyPI.

Project details

Download files

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

Files for django-mail-viewer, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django_mail_viewer-1.0.0-py2.py3-none-any.whl (12.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-mail-viewer-1.0.0.tar.gz (19.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page