Email History for Django Anymail
Project description
anymail-history - Email History (database storage) for Django Anymail
Keep history of all emails sent by Django Anymail
Introduction
anymail-history implements database storage for Django Anymail.
Resources
- Package on PyPI: https://pypi.org/project/anymail-history/
- Project on Github: https://github.com/pfouque/django-anymail-history
Features
- Store sent emails
- Store tracking events
- Display Admin
- html templating ?
Requirements
- Django >=3.2
- Python >=3.8
How to
-
Install
$ pip install "django-anymail-history"
-
Register anymail_history in your list of Django applications:
INSTALLED_APPS = [ # ... "anymail", "anymail_history", # ... ]
-
Then migrate the app to create the database table
manage.py migrate
-
🎉 Voila!
Settings
You can add settings to your project’s settings.py either as a single ANYMAIL
dict, or by breaking out individual settings prefixed with ANYMAIL_. So this settings dict:
ANYMAIL = {
"STORE_HTML": True,
}
…is equivalent to these individual settings:
ANYMAIL_STORE_HTML = True
Available settings
ANYMAIL_STORE_FAILED_SEND
: (default: False) Store message even if esp didn't returned a message-id.ANYMAIL_STORE_HTML
: (default: False) Store html alternatives.
Contribute
Principles
- Simple for developers to get up-and-running
- Consistent style (
black
,ruff
) - Future-proof (
pyupgrade
) - Full type hinting (
mypy
)
Coding style
We use pre-commit to run code quality tools.
Install pre-commit however you like (e.g.
pip install pre-commit
with your system python) then set up pre-commit to run every time you
commit with:
> pre-commit install
You can then run all tools:
> pre-commit run --all-files
It includes the following:
poetry
for dependency managementRuff
,black
andpyupgrade
lintingmypy
for type checkingGithub Actions
for builds and CI
There are default config files for the linting and mypy.
Tests
Tests package
The package tests themselves are outside of the main library code, in a package that is itself a
Django app (it contains models
, settings
, and any other artifacts required to run the tests
(e.g. urls
).) Where appropriate, this test app may be runnable as a Django project - so that
developers can spin up the test app and see what admin screens look like, test migrations, etc.
Running tests
The tests themselves use pytest
as the test runner. If you have installed the poetry
evironment,
you can run them thus:
$ poetry run pytest
or
$ poetry shell
(anymail-history-py3.10) $ pytest
CI
-
.github/workflows/lint.yml
: defines and ensure coding rules on Github. -
.github/workflows/test.yml
: Runs tests on all compatible combinations of Django (3.2+) & Anymail(8.4+), Python (3.8+)in a Github matrix. -
.github/workflows/coverage.yml
: Calculates the coverage on an up to date version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file anymail_history-0.1.8.tar.gz
.
File metadata
- Download URL: anymail_history-0.1.8.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.12 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb6a650bea7dc15f40d41362a6f411878a515003f233b2417c07ccf5ee21704 |
|
MD5 | 7ef947d7ef1e9ba9ed4eb075f251c244 |
|
BLAKE2b-256 | e9b8f0ed3ffb6de3e8c0f9e5685d1f9b1ac87cbd1b5519fdd16296614afcc7ec |
File details
Details for the file anymail_history-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: anymail_history-0.1.8-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.12 Linux/6.2.0-1015-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 744acc5f5f3bccd670f6303810c0f1e57563e2222c44282f9e86850ba844a33e |
|
MD5 | 980b40ff7007f2499f185616eacad2b3 |
|
BLAKE2b-256 | 258261f8d8abbca092d3aea008445f3be074846bd3e5501bd1422d8c46c593b0 |