... 送信します。 django.server を除く全てのロガーは、ルートの django ロガーまで、親に対してログを伝播させます。 console と mail_admins ハンドラは、上述の動作を提供するためにルートロガーにアタッチされます。 Pythonのデフォルトは、レベル WARNING 以上のレコード ... " , }, "django.server" : { "level" : "INFO" , "class" : "logging.StreamHandler" , "formatter" : "django.server" , }, "mail_admins" : { "level" : "ERROR" , "filters" : [ "require_debug_false" ], "class" : "django.utils.log.AdminEmailHandler" , }, }, "lo ... ggers" : { "django" : { "handlers" : [ "console" , "mail_admins" ], "level" : "INFO" , }, "django.server" : { "handlers" : [ "django.server" ], "level" : "INFO" , "propagate" : False , } ... ... el" : "INFO" , "filters" : [ "require_debug_true" ], "class" : "logging.StreamHandler" , "formatter" : "simple" , }, "mail_admins" : { "level" : "ERROR" , "class" : "django.utils.log.AdminEmailHandler" , "filters" : [ "special" ], }, }, "loggers" : { " ... django" : { "handlers" : [ "console" ], "propagate" : True , }, "django.request" : { "handlers" : [ "mail_admins" ], "level" : "ERROR" , "propagate" : False , }, "myproject.custom" : { "handlers" : [ "console" , "mail_admins" ], "level ... セージを sys.stderr に表示 (print) する StreamHandler クラスです。このハンドラは simple 出力フォーマットを使用します。 mail_admins は、 ERROR (またはそれより上) のすべてのメッセージをサイトの ADMINS にメール送信する AdminEmailHandler クラスです。このハン ... ... ction() and the connection arguments to mail functions The fail_silently argument to send_mail() , send_mass_mail() , mail_admins() , mail_managers() , and EmailMessage.send() The auth_user and auth_password arguments to send_mail() and send_mass_mail( ... email1 , email2 ]) Replacing fail_silently The deprecated fail_silently arguments to send_mail() , send_mass_mail() , mail_admins() , mail_managers() , and EmailMessage.send() can be replaced in several ways. Existing usage seems to have several differ ... on, referring to it with the using argument. For example, if your settings include: LOGGING = { # ... "handlers" : { "mail_admins" : { "class" : "django.utils.log.AdminEmailHandler" , "email_backend" : "third.party.EmailBackend" , }, }, # ... } Replace ... ... を作成したい場合は ref 要素を使用します。 次に、設定がどのようにアノテーションされているかに注目してください: .. setting :: ADMINS ADMINS ====== Default: ``[]`` (Empty list) A list of all the people who get code error notifications... これにより、以降の ... ヘッダが ADMINS という設定の "正規の" ターゲットとしてマークアップされます。これは ADMINS について話すときはいつでも :setting:`ADMINS` を使 ... ... mple.com" ]), ( "Subject" , "Message." , "from@example.com" , [ "jane@example.com" ]), ) send_mass_mail ( datatuple ) mail_admins() mail_admins ( subject , message , * , fail_silently = False , connection = None , html_message = None , using = None ) [ ... ソース] django.core.mail.mail_admins() は、 ADMINS 設定で定義されているサイト管理者 (admin) に対してメールを送信するためのショートカットです。 mail_admins() は ... tly = False , connection = None , html_message = None , using = None ) [ソース] django.core.mail.mail_managers() は、 mail_admins() とほぼ同じで、 MANAGERS 設定で定義されているサイト管理者 (manager) にメールを送信します。 The keyword argument using is ... ... して内部サーバーエラーが起きると (厳密には、500 以上の HTTP ステータスコードを持つ全てのレスポンスが返ってくると)、Django は ADMINS 設定のリストに含まれるユーザーにメールを送信します。これにより、管理者はすぐにエラーの通知を受け取ることができます。メール ... には、 ADMINS はエラーの説明、Python のトレースバック全体、エラーを引き起こした HTTP リクエストの詳細について書かれています。 注釈 メール ... ss. To use a different sender address, modify the SERVER_EMAIL setting. この動作を有効にするには、受信者のメールアドレスを ADMINS 設定に含めます。 参考 サーバーエラーのメールはロギングフレームワークを使って送信されるので、 ロギングの設定をカスタマイズす ... ... 受け取ったらすぐにそれらが想定通り動作していることを確認してください。 ロギングに関する詳細は ロギング を参照してください。 ADMINS と MANAGERS ADMINS は、500 エラーの通知を E メールで受け取ります。 MANAGERS は、404 エラーの通知を受け取ります。 IGNORABLE ... ... . slug ), } この設定で使用するモデル名は、実際のモデルクラス名の大文字小文字に関わらず、すべて小文字である必要があります。 ADMINS デフォルト値: [] (空のリスト) コードエラー通知を受け取る全ての人々のリストです。 DEBUG=False が設定され、 AdminEmailHandle ... スポンスサイクルで発生した例外の詳細をメールで送信します。 Each item in the list should be an email address string. Example: ADMINS = [ "john@example.com" , '"Ng, Mary" <mary@example.com>' ] To safely build an address with a display name from variable co ... OSTS も適切に設定する必要があります。これを怠ると、すべてのリクエストが "Bad Request (400)" として返されます。 注釈 django-admin startproject によって作成されるデフォルトの settings.py ファイルは、利便性のために DEBUG = True に設定されています。 DEBUG_ ... ... s setting has now been deprecated and replaced by the more general setting STATIC_URL . Django will now expect to find the admin static files under the URL <STATIC_URL>/admin/ . If you've previously used a URL path for ADMIN_MEDIA_PREFIX (e.g. /media/ ... etting to the correct URL -- for example, http://media.example.com/ . 警告 If you're implicitly relying on the path of the admin static files within Django's source code, you'll need to update that path. The files were moved from django/contrib/admin/m ... = { # ... "filters" : { "require_debug_false" : { "()" : "django.utils.log.RequireDebugFalse" , } }, "handlers" : { "mail_admins" : { "level" : "ERROR" , "filters" : [ "require_debug_false" ], "class" : "django.utils.log.AdminEmailHandler" , } }, } If ... ... 機能 django.contrib.admin The Font Awesome Free icon set (version 6.7.2) is now used for the admin interface icons. The new AdminSite.password_change_form attribute allows customizing the form used in the admin site password change view. Message levels ... od ends: All optional parameters ( fail_silently and later) must be passed as keyword arguments to get_connection() , mail_admins() , mail_managers() , send_mail() , and send_mass_mail() . All parameters must be passed as keyword arguments when creatin ... to assuming HTTPS during the Django 6.x release cycle. The URLIZE_ASSUME_HTTPS transitional setting is deprecated. Setting ADMINS or MANAGERS to a list of (name, address) tuples is deprecated. Set to a list of email address strings instead. Django neve ... 2026年10月08日