Trouble configuring Django to use Amazon SES for email

I’m working on a Django project and I’m trying to set up Amazon SES for sending emails. I installed a package to help with this and added some settings to my settings.py file. The settings include the email backend, AWS region, endpoint, and access keys.

But there’s a problem. When I use mail.get_connection(), it still shows that it’s using the console email backend. This happens both in the shell and when I run the dev server.

I also tried setting up a regular SMTP configuration, but I got the same result.

Does anyone know why the email backend isn’t changing? I’m pretty confused about this. Is there something else I need to do to make Django use the SES backend?

Here’s a simplified version of what I added to my settings:

EMAIL_STUFF = {
    'backend': 'my_ses_backend.EmailSender',
    'region': 'us-east-1',
    'endpoint': 'email.us-east-1.example.com',
    'id': 'my_access_id',
    'key': 'my_secret_key'
}

Any help would be great. Thanks!

hmmm, interesting issue! have u tried printing out the actual email backend being used? maybe there’s a conflict somewhere. also, are u sure the ses package is compatible with ur django version? sometimes version mismatches can cause weird behavior. what happens if u try sending a test email directly?

have u tried clearing ur cache and restarting the server? sometimes django caches settings and doesn’t pick up changes right away. also double check ur INSTALLED_APPS to make sure the ses backend app is included. if that doesn’t work, try explicitly setting EMAIL_BACKEND in settings.py instead of using a dict.

I encountered a similar issue when setting up SES with Django. One crucial step that’s often overlooked is ensuring that the SES backend is properly initialized. Try adding ‘EMAIL_BACKEND = “django_ses.SESBackend”’ directly in your settings.py file, rather than using a dictionary. Also, verify that you’ve added ‘django_ses’ to your INSTALLED_APPS. If these don’t resolve the issue, check your AWS credentials and ensure they have the necessary permissions for sending emails through SES. Lastly, confirm that your SES account is out of the sandbox mode if you’re trying to send to non-verified email addresses.