views:

114

answers:

2

Django will email ADMINS upon 500 errors.

Reading app-engine-patch docs, it claims to enable mail support, but I can't tell if it does so enough to support 500 emailing.

I tried it and it doesn't seem to be working, but it is a silent failure with no log messages, so I might have misconfigured something.

Does anyone have experience with app-engine-patch emailing ADMINS upon 500?

A: 

I was getting silent errors just as you describe; the only clue I had was that the sent email quota was getting used.

I already had DEBUG and ADMIN configured in my settings.py; after adding SERVER_EMAIL to specify the sender everything started working:

DEBUG= false
SERVER_EMAIL = '[email protected]'
ADMINS = (
    ('Reporting email', '[email protected]'),
)

Now I'm receiving emails on 500 errors.

morais
+3  A: 

Turns out I had misconfigured.

BAD configuration:

ADMINS = ['[email protected]', '[email protected]']

GOOD configuration:

ADMINS = (('name1', '[email protected]'), \
          ('name2', '[email protected]'))

See the docs about ADMINS.

Also, be cautious about a tuple with a single entry, which due to Python requires a trailing comma:

ADMINS = (('name1', '[email protected]'),)
dfrankow