{"id":21156,"library":"django-post-office","title":"django-post-office","description":"A Django app to monitor and send mail asynchronously, complete with template support. Current version 3.11.2, released Feb 2026. Release cadence is irregular, roughly 2-4 minor versions per year.","status":"active","version":"3.11.2","language":"python","source_language":"en","source_url":"https://github.com/ui/django-post_office","tags":["django","email","async","queue","background-tasks"],"install":[{"cmd":"pip install django-post-office","lang":"bash","label":"pip"}],"dependencies":[{"reason":"Core framework","package":"django","optional":false},{"reason":"HTML sanitization","package":"nh3","optional":false},{"reason":"Deprecated in v3.7.0, use Django's JSONField","package":"jsonfield","optional":true}],"imports":[{"note":"mail is a module, not a model","wrong":"from post_office.models import mail","symbol":"mail","correct":"from post_office import mail"},{"note":"","wrong":"","symbol":"Email","correct":"from post_office.models import Email"},{"note":"get_queued is a method on Email.objects","wrong":"from post_office import get_queued","symbol":"get_queued","correct":"from post_office.models import Email"},{"note":"It's mail.send, not mail.send_mail","wrong":"mail.send_mail(...)","symbol":"send_mail","correct":"from post_office import mail; mail.send(...)"}],"quickstart":{"code":"import django\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'your_project.settings')\ndjango.setup()\nfrom post_office import mail\nmail.send(\n    recipients=['user@example.com'],\n    sender='from@example.com',\n    subject='Test email',\n    message='Hello, World!',\n    priority='now'\n)","lang":"python","description":"Send an email immediately using django-post-office."},"warnings":[{"fix":"Ensure `nh3` is installed, and remove any direct use of `bleach` in post_office contexts.","message":"In v3.11.0, the dependency `bleach` was replaced with `nh3` for HTML sanitization. If you rely on `bleach` directly or indirectly, update your code.","severity":"breaking","affected_versions":">=3.11"},{"fix":"Run `makemigrations` to regenerate migrations after upgrading. Remove any explicit dependency on `jsonfield`.","message":"In v3.7.0, JSON columns were changed from third-party `jsonfield` to Django's native `JSONField`. If you have custom migrations that depend on `jsonfield`, they will break.","severity":"breaking","affected_versions":">=3.7"},{"fix":"Do not rely on `date_hierarchy`. Use list_filters or custom filters instead.","message":"The `date_hierarchy` option was removed in v3.7.1 from the Email admin, causing slow loading on large databases. If you rely on date-based drilldown in admin, implement custom admin filters.","severity":"deprecated","affected_versions":">=3.7.1"},{"fix":"Use `template='your_template'` and pass context as a dict. Test with `priority='now'` to see errors immediately.","message":"When using `mail.send` with a template, context must include all variables needed, but if the template is missing or invalid, the email fails silently. Always check the backend logs.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install django-post-office` and add 'post_office' to INSTALLED_APPS in settings.py.","cause":"Package not installed or not added to INSTALLED_APPS.","error":"ModuleNotFoundError: No module named 'post_office'"},{"fix":"Call `django.setup()` after setting the DJANGO_SETTINGS_MODULE environment variable.","cause":"Using post_office outside of Django's setup, e.g., in a standalone script without calling django.setup().","error":"django.core.exceptions.ImproperlyConfigured: Requested setting POST_OFFICE, but settings are not configured."},{"fix":"Use `from post_office import mail; mail.send(...)`.","cause":"Incorrect function name; the correct function is `mail.send()`.","error":"AttributeError: module 'post_office' has no attribute 'send_mail'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}