Package: django-pony-express
Welcome to thedjango-pony-express- class-based emails for Django shipping with a full test
suite.Similar to class-based view in Django core, this package provides a neat, DRY and testable (!) way to handle your
emails in Django.PyPIGitHubFull documentationCreator & Maintainer:Ambient DigitalFeaturesClass-based structure for emailsAvoid duplicate low-level setupUtilise inheritance and OOP benefitsNo duplicated templates for HTML and plain-textTest suite to write proper unit-tests for your emailsAccess your test outbox like a Django querysetEtymologyThe Pony Express was an American express mail service that used relays of horse-mounted riders. [...] During its
18 months of operation, the Pony Express reduced the time for messages to travel between the east and west US
coast to about 10 days.https://en.wikipedia.org/wiki/Pony_ExpressThe name of this package combines the Django mascot (a pony) with a once quite successful mail service in the US.
Ingenious, right?InstallationInstall the package via pip:pip install django-pony-expressor via pipenv:pipenv install django-pony-expressAdd module toINSTALLED_APPSwithin the main djangosettings.py:INSTALLED_APPS = (
    ...
    'django_pony_express',
)ContributeSetup package for developmentCreate a Python virtualenv and activate itInstall "pip-tools" withpip install -U pip-toolsCompile the requirements withpip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtrackingSync the dependencies with your virtualenv withpip-syncAdd functionalityCreate a new branch for your featureChange the dependency in your requirements.txt to a local (editable) one that points to your local file system:-e /Users/workspace/django-pony-expressor via pippip install -e /Users/workspace/django-pony-expressEnsure the code passes the testsCreate a pull requestRun testsRun testspytest --ds settings testsCheck coveragecoverage run -m pytest --ds settings tests
coverage report -mGit hooks (via pre-commit)We use pre-push hooks to ensure that only linted code reaches our remote repository and pipelines aren't triggered in
vain.To enable the configured pre-push hooks, you need toinstallpre-commit and run once:pre-commit install -t pre-push -t pre-commit --install-hooksThis will permanently install the git hooks for both, frontend and backend, in your local.git/hooksfolder.
The hooks are configured in the.pre-commit-config.yaml.You can check whether hooks work as intended using theruncommand:pre-commit run [hook-id] [options]Example: run single hookpre-commit run ruff --all-files --hook-stage pushExample: run all hooks of pre-push stagepre-commit run --all-files --hook-stage pushUpdate documentationTo build the documentation run:sphinx-build docs/ docs/_build/html/.Opendocs/_build/html/index.htmlto see the documentation.Translation filesIf you have added custom text, make sure to wrap it in_()where_is
gettext_lazy (from django.utils.translation import gettext_lazy as _).How to create translation file:Navigate todjango-pony-expresspython manage.py makemessages -l deHave a look at the new/changed files withindjango_pony_express/localeHow to compile translation files:Navigate todjango-pony-expresspython manage.py compilemessagesHave a look at the new/changed files withindjango_pony_express/localePublish to ReadTheDocs.ioFetch the latest changes in GitHub mirror and push themTrigger new build at ReadTheDocs.io (follow instructions in admin panel at RTD) if the GitHub webhook is not yet set
up.Publish to PyPiUpdate documentation about new/changed functionalityUpdate theChangelogIncrement version in main__init__.pyCreate pull request / merge to masterThis project uses the flit package to publish to PyPI. Thus publishing should be as easy as running:flit publishTo publish to TestPyPI use the following ensure that you have set up your .pypirc as
shownhereand use the following command:flit publish --repository testpypiMaintenancePlease note that this package supports theambient-package-update.
So you don't have to worry about the maintenance of this package. All important configuration and setup files are
being rendered by this updater. It works similar to well-known updaters likepyupgradeordjango-upgrade.To run an update, refer to thedocumentation pageof the "ambient-package-update".