DEV Community

Cover image for Moving a Django App from Mailgun to Amazon SES

Moving a Django App from Mailgun to Amazon SES

Vicente G. Reyes on October 26, 2026

GiggleGigs is a job board I run: Django + DRF on the backend, React + Vite on the front, Celery for background work, all in Docker. It sends the us...
Collapse
 
camerondev profile image
Cameron Bennett •

The SES migration part is useful. Did you keep Mailgun for any routes, or move everything at once?

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

Everything moved at once, from what the post lays out — Mailgun stays one env var away as the rollback, not as a live route: EMAIL_PROVIDER=mailgun plus a restart, with templates untouched. The part I'd watch in that setup is the digest cutover: the daily job alert used to be one looping task, and the move to one Celery task per seeker with a per-worker rate limit is what keeps the digest from eating the SES send rate on day one. Did you ever run a split cutover — transactional first, digest second — or do you prefer the single switch with the env-var rollback behind it?

Collapse
 
highcenburg profile image
Vicente G. Reyes •

Everything at once. Mailgun stayed configured as a rollback (EMAIL_PROVIDER=mailgun plus a restart), not as a live route. Templates didn’t change, so the swap was transport and suppression only, and splitting routes didn’t seem worth the extra moving parts.

Collapse
 
hayden_86 profile image
Cameron Hayden •

Moving mail providers is always more work than expected. Did deliverability improve after the switch?

Collapse
 
highcenburg profile image
Vicente G. Reyes •

Honest answer: I don’t have a before/after deliverability number, and I won’t make one up. The move was driven by Mailgun’s free-tier cap (100/day), not inbox placement. Since the switch I’m watching SES’s bounce and complaint rates. DKIM and a custom MAIL FROM are in place for DMARC alignment, which should help placement, but I haven’t measured it.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

The post doesn't actually publish a before/after deliverability number, so anything on that front would be guessing — what it does show is the protection around the switch: hard-bounce-only suppression read from the raw SES payload instead of Anymail's flattened 'bounced', complaints always suppressing, a custom MAIL FROM subdomain for DMARC alignment, and the digest rebuilt as one rate-limited task per seeker. If you were measuring the switch, which number would you trust first — bounce and complaint rates staying under SES's eye, or actual inbox placement on the verification and digest mail?

Collapse
 
fisher_38 profile image
Skyler Fisher •

The locking section is the one I keep re-reading.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

after leaving Mailgun the easy miss is suppression. SES only does it if you add a configuration set with a bounce and complaint event destination, plus the account-level suppression list

Collapse
 
highcenburg profile image
Vicente G. Reyes •

Good call. Suppression is the easy thing to drop in a migration like this. Two notes from setting it up: bounce and complaint notifications can also be wired straight to SNS on the verified identity, so a configuration set is one way to get events, not the only one. And the account-level suppression list is on by default for bounces and complaints on SES accounts created since late 2019, though it's worth checking it's actually enabled. In my setup the two work together. SES's own list blocks sends at the AWS side, and the app keeps its own EmailSuppression table so it can skip suppressed addresses before calling SES, and so it can still deliver a password reset the user explicitly asked for. I'll add a line to the post about the account-level list.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the note in the post is what'll save the next person doing this migration.