Max
Max

Reputation: 1

How can I get Django on Google App Engine to automatically email server 500 errors to Admins?

When my App raises a server 500 error, I'm not receiving the automatic Django email that it should be sending: https://docs.djangoproject.com/en/1.3/howto/error-reporting/

I'm using the Google App Engine Django Helper at http://code.google.com/p/google-app-engine-django/

In my settings.py file:

DEBUG = False
ADMINS = (('Support', 'Support@******.com'),)
EMAIL_HOST = ''
SERVER_EMAIL = 'Support@******.com'

In the Google App Engine Dashboard, I've added Support@**.com (The same email in my settings.py) to the admins with the role of Viewer. I've tried changing the role to Developer.

I think the problem is this line:

EMAIL_HOST = ''

Since the Django docs say

In order to send e-mail, Django requires a few settings telling it how to connect to your mail server. At the very least, you’ll need to specify EMAIL_HOST. . .

But, the there are comments in the settings.py file that came with the google-app-engine-django project that say

# Ensure that email is not sent via SMTP by default to match the standard App
# Engine SDK behaviour. If you want to send email via SMTP then add the name of
# your mailserver here.
EMAIL_HOST = ''

Upvotes: 0

Views: 426

Answers (1)

punteney
punteney

Reputation: 63

Make sure you specify the 'SERVER_EMAIL' (https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SERVER_EMAIL) in your settings. Otherwise the emails will be sent from "root@localhost" and AppEngine won't send them.

Upvotes: 1

Related Questions