具有 app-engine-patch 的 Google App Engine 是否支持在出现 500 个错误时向 ADMINS 发送电子邮件?

发布于 2024-08-04 20:19:44 字数 410 浏览 4 评论 0原文

Django 将通过电子邮件发送ADMINS 出现 500 错误。

阅读 app-engine-patch 文档,它声称启用邮件支持,但我不知道它是否足以支持 500 封电子邮件。

我尝试了一下,它似乎不起作用,但这是一个无提示的故障,没有日志消息,所以我可能配置错误。

有人有在 500 上向管理员发送应用程序引擎补丁电子邮件的经验吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡绿茶香 2024-08-11 20:19:44

原来是我配置错误。

错误的配置:

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

良好的配置:

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

请参阅有关 ADMINS 的文档

另外,请谨慎对待具有单个条目的元组,因为 Python 需要尾随逗号:

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

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]'),)
抚笙 2024-08-11 20:19:44

正如您所描述的那样,我遇到了无声错误;我唯一的线索是发送的电子邮件配额已被使用。

我已经在 settings.py 中配置了 DEBUGADMIN;添加 SERVER_EMAIL 指定发件人后,一切开始正常工作:

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

现在我收到有关 500 错误的电子邮件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文