No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
django_mail_viewer
docs
tests
.editorconfig
.flake8
.gitignore
.style.yapf
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
README.rst
requirements.txt
requirements_dev.txt
requirements_test.txt
runtests.py
setup.cfg
setup.py
tox.ini

README.rst

Django Mail Viewer

https://badge.fury.io/py/django-mail-viewer.png https://travis-ci.org/jmichalicek/django-mail-viewer.png?branch=master

View emails in development without actually sending them.

Documentation

The full documentation is at https://django-mail-viewer.readthedocs.io.

Quickstart

Install Django Mail Viewer:

pip install django-mail-viewer

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_mail_viewer',
    ...
)

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')),
    ...
]

Set your EMAIL_BACKEND in settings.py:

EMAIL_BACKEND = 'django_mail_viewer.backends.locmem.EmailBackend'

Features

  • TODO

Running Tests

Does the code actually work?

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

TODO

  • 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?

Credits

Tools used in rendering this package: