checks.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:zing 作者: evernote 项目源码 文件源码
def check_email_server_is_alive(app_configs=None, **kwargs):
    from django.conf import settings

    errors = []
    if settings.POOTLE_SIGNUP_ENABLED or settings.POOTLE_CONTACT_ENABLED:
        from django.core.mail import get_connection

        connection = get_connection()
        try:
            connection.open()
        except Exception:
            errors.append(checks.Warning(
                _("Email server is not available."),
                hint=_("Review your email settings and make sure your email "
                       "server is working."),
                id="pootle.W004",
            ))
        else:
            connection.close()
    return errors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号