... s two complementary headers: Content-Security-Policy : Enforces 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 testin ... g. Each policy is composed of one or more directives and their values, which together instruct the browser on how to handle specific types of content. When the ContentSecurit ... immediate feedback during development. To also receive these reports programmatically, the policy must include a reporting directive such as report-uri that specifies where violation data should be sent. Django supports configuring these directives via th ... ... er. For example, use :cve:`2019-14232` . When documenting Python objects (classes, methods, attributes, etc.) using Sphinx directives such as .. class:: , .. method:: , and .. attribute:: , all content must be properly indented to ensure correct rendering ... and to support features like automatic table of contents generation. Follow these rules: The directive itself remains flush with the left margin (no indentation). All descriptive text under the directive must be indented by 4 ... spaces. Multi-line descriptions must keep the same indentation level. Nested directives (for example, methods inside a class) require an additional 4 spaces of indentation to maintain hierarchy. Field lists (s ... ... to/mysite.com/mysite/wsgi.py Require group secret-agents Require valid-user </Location> To support the WSGIAuthGroupScript directive, the same WSGI script mysite.wsgi must also import the groups_for_user function which returns a list of groups the given u ... ... リシー (Cross-Origin Opener Policy) ヘッダを設定します。 SECURE_CSP New in Django 6.0. Default: {} This setting defines the directives used by the ContentSecurityPolicyMiddleware , which generates and adds a Content-Security-Policy (CSP) header to all resp ... es for content such as scripts, styles, images, fonts, and more. The setting must be a mapping (typically a dictionary) of directive names to their values. Each key should be a valid CSP directive such as default-src or script-src . The corresponding valu ... e can be a list, tuple, or set of source expressions or URLs to allow for that directive. If a set is used, it will be automatically sorted to ensure consistent output in the generated headers. This example illu ... ... キャッシュ The cache_control() decorator and patch_cache_control() method now support multiple field names in the no-cache directive for the Cache-Control header, according to RFC 7234 Section 5.2.2.2 . delete() は、キーが正常に削除された場合は True を返し ... .debug.SafeExceptionReporterFilter . The cache timeout set by cache_page() decorator now takes precedence over the max-age directive from the Cache-Control header. Providing a non-local remote field in the ForeignKey.to_field argument now raises FieldErro ... ... increased from 1.3.3 to 1.3.7. SQLite < 3.7.15 に対するサポートが削除されました。 The date format of Set-Cookie 's Expires directive is changed to follow RFC 7231 Section 7.1.1.1 instead of Netscape's cookie standard. Hyphens present in dates like Tue, 25 ... ... ue is get_language() instead of LANGUAGE_CODE . キャッシュ add_never_cache_headers() and never_cache() now add the private directive to Cache-Control headers. ファイルストレージ The new Storage.get_alternative_name() method allows customizing the algorith ... ... ble size in order to prevent denial of service (DOS) attacks. In Apache, this can be easily set using the LimitRequestBody directive. You should not rely solely on DATA_UPLOAD_MAX_MEMORY_SIZE nor FILE_UPLOAD_MAX_MEMORY_SIZE . 独自の静的ファイルを提供してい ... d debugging. For configuration instructions, see the Using CSP documentation, and refer to the CSP overview for details on directives and settings. Limitations and considerations While CSP is a powerful security mechanism, it's important to understand its ... onments, measure the performance impact accordingly. Browser support: While CSP Levels 1 and 2 are widely supported, newer directives (CSP Level 3+) or complex policy behaviors may vary across browsers. Test your policy across the environments you intend ... ... with the rendered template fragment. Template partials can also be included using the include template tag with the same # directive: {% include "authors.html#user-info" %} Context handling Template partials are rendered with the current template context. ... ... Length レスポンスヘッダをセットするようになりました。 Added the SECURE_HSTS_PRELOAD setting to allow appending the preload directive to the Strict-Transport-Security header. ConditionalGetMiddleware now adds the ETag header to responses. シリアライズ (シリ ... 2026年10月08日