Changes between Initial Version and Version 1 of Ticket #37345, comment 4


Ignore:
Timestamp:
Sep 14, 2026, 10:51:56 AM (3 weeks ago)
Author:
Mike Edmunds

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37345, comment 4

    initial v1  
    11As pointed out in comment:1, `django.core.mail.mailers.default` returns the default mailer instance ([https://docs.djangoproject.com/en/6.1/topics/email/#django.core.mail.mailers.default docs]). It is [https://github.com/django/deps/blob/main/accepted/0018-mailers.md#mailers-factory:~:text=mailers.default%20is,the%20next%20section.) meant to parallel] `django.db.connection`, `django.core.cache.cache`, `django.tasks.default_task_backend`, and similar accessors.
    22
    3 We can't create a module-level accessor like `django.core.mail.default_mailer`, because Django's `ConnectionProxy` and `LazyObject` helpers (used for module-level accessors) require cacheable instances. In general, `EmailBackend` instances [https://github.com/django/deps/blob/main/accepted/0018-mailers.md#mailers-instances-are-not-cached are not cacheable].
     3We can't easily create a module-level accessor like `django.core.mail.default_mailer` using `ConnectionProxy` or `LazyObject` (like the similar accessors do) because those require cacheable instances. In general, `EmailBackend` instances [https://github.com/django/deps/blob/main/accepted/0018-mailers.md#mailers-instances-are-not-cached are not cacheable].
Back to Top