... 制約のバリデーション 制約は モデルのバリデーション の間にチェックされます。 BaseConstraint class BaseConstraint ( * name , violation_error_code = None , violation_error_message = None ) [ソース] すべての制約の基底クラスです。サブクラスは constraint_sql() ... に共通するパラメータは以下の通りです: name BaseConstraint. name 制約の名前。制約には常に一意な名前を指定する必要があります。 violation_error_code BaseConstraint. violation_error_code モデルのバリデーション 中に ValidationError が発生した場合に使用されるエラ ... ーコードです。デフォルトは None です。 violation_error_message BaseConstraint. violation_error_message モデルのバリデーション の実行中に ValidationError が発生した場合に表 ... ... lusionConstraint ( * , name , expressions , index_type = None , condition = None , deferrable = None , include = None , violation_error_code = None , violation_error_message = None ) [ソース] データベースに排他制約を作成します。内部的には、PostgreSQLは ... グする ( expressions ) クエリにインデックスのみのスキャンを使用できます。 include is supported for GiST and SP-GiST indexes. violation_error_code ExclusionConstraint. violation_error_code モデルのバリデーション 中に ValidationError が発生した場合に使用される ... エラーコードです。デフォルトは None です。 violation_error_message モデルのバリデーション 中に ValidationError が発生した場合に使用されるエラーメッセージです。デフォルトは Bas ... ... s the CSP policy, blocking content that violates the defined directives. Content-Security-Policy-Report-Only : Reports CSP violations without blocking content, allowing for non-intrusive testing. Each policy is composed of one or more directives and their ... Use SECURE_CSP_REPORT_ONLY on its own to evaluate a new policy without disrupting site behavior. This mode does not block violations, it only logs them. It's useful for testing and monitoring, but provides no protection against active threats. Use both t ... rts can help detect regressions, unexpected changes in behavior, or potential tampering in production environments. Policy violation reports When a CSP violation occurs, browsers typically log details to the developer console, providing immediate feedback ... ... 、アサーションメソッド MessagesTestMixin.assertMessages() が追加されました。 django.contrib.postgres ExclusionConstraint に violation_error_code 属性が追加され、 オブジェクトの検証 中に発生する ValidationError の code をカスタマイズできるようになりました。 ... ィールド値を指定できる create_defaults 引数が追加されました。 BaseConstraint 、 CheckConstraint 、および UniqueConstraint に violation_error_code 属性が追加され、 オブジェクトの検証 中に発生する ValidationError の code をカスタマイズすることができるようにな ... angoDivFormRenderer と Jinja2DivFormRenderer トランジショナルフォームレンダラーが非推奨になりました。 位置引数 name および violation_error_message を BaseConstraint に渡す方法は、キーワード専用引数を使用する方法に変更されるため、非推奨となりました。 reque ... ... pes はリクエストの Accept ヘッダーに基づき、クライアントの設定によってソートされるようになりました。 属性 UniqueConstraint.violation_error_code と UniqueConstraint.violation_error_message は指定されれば常に使用されるように変更されました。従来は UniqueCons ... ... s humanize messages postgres redirects sessions sites sitemaps syndication コンテンツセキュリティポリシー 概要 設定 Policy violation reports CSP 定数 デコレータ Nonce usage クロスサイトリクエストフォージェリ (CSRF) 対策 しくみ 制限事項 ユーティリティ 設定 ... ... are to apply a Content-Security-Policy-Report-Only header to responses, which allows browsers to monitor and report policy violations without blocking content. This is useful for testing and refining a policy before enforcement. Most browsers log CSP viol ... tionally send them to a reporting endpoint. To collect these reports, the report-uri directive must be defined (see Policy violation reports for more details). As noted in the MDN documentation on Content-Security-Policy-Report-Only , the report-uri direc ... 2026年10月08日