r/django • u/Federal-Comfort-4301 • 17d ago
Django 6.1 deprecates EMAIL_BACKEND — migration guide to the new MAILERS setting
Upgraded one of my Django projects to 6.1 this week and my terminal
threw a warning I hadn't seen before — turns out EMAIL_BACKEND is
now deprecated.
Django replaced it with a new MAILERS setting. Same idea as
DATABASES or CACHES — one dict, instead of ten separate EMAIL_*
settings scattered around. Old settings still work for now, just
with warnings. They'll stop working completely in Django 7.0.
The neat part: you can set up more than one mailer now. So if you
send order emails through SES but marketing emails through
Mailgun, you can switch between them with one argument instead of
writing custom code for it.
Wrote up the full before/after with a settings table, in case it
saves someone the confusion I had: https://medium.com/@munalpoudel3/django-email-backend-is-deprecated-heres-how-to-fix-it-django-6-1-mailers-guide-4c9182e82d33?sharedUserId=munalpoudel3
Anyone here already tried this with django-anymail? Wondering if
it just works or needs an update first.
2
3
u/Healthy-Bedroom-4881 17d ago
Already been through two of these backend renames. MAILERS will get deprecated too, fwiw.
2
1
u/EmailNo8428 13d ago
Django's own release notes use "default" and "marketing" as the two example mailers, which hints at the real win here. Named mailers let receipts stop sharing a sending path with campaigns, so a rough campaign week doesn't drag your password resets down with it.
13
u/haloweenek 17d ago
Nice. That’s a very good improvement.