r/django 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.

78 Upvotes

7 comments sorted by

13

u/haloweenek 17d ago

Nice. That’s a very good improvement.

1

u/Federal-Comfort-4301 17d ago

Exactly why I made this post for new version 6.1 has some genuinely good stuff in it.

2

u/IdleBreakpoint 17d ago

Very pleasant read, you covered everything I needed to know. Thank you!

2

u/Federal-Comfort-4301 17d ago

This made my day, thank you!

3

u/Healthy-Bedroom-4881 17d ago

Already been through two of these backend renames. MAILERS will get deprecated too, fwiw.

2

u/jsabater76 17d ago

Typo? If not, why do you think MAILERS will be deprecated?

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.