... uration , so as to ensure that only modules the developer intended to be imported in this fashion can or will be imported. Caching of anonymous pages could reveal CSRF token Django includes both a caching framework and a system for preventing cross-site ... ust be sent by the client on future requests and, in forms, a hidden value which must be submitted back with the form. The caching framework includes an option to cache responses to anonymous (i.e., unauthenticated) clients. When the first anonymous req ... ttacker to obtain a valid CSRF cookie value and perform attacks which bypass the check for the cookie. To remedy this, the caching framework will no longer cache such responses. The heuristic for this will be: If the incoming request did not submit any ... ... uration , so as to ensure that only modules the developer intended to be imported in this fashion can or will be imported. Caching of anonymous pages could reveal CSRF token Django includes both a caching framework and a system for preventing cross-site ... ust be sent by the client on future requests and, in forms, a hidden value which must be submitted back with the form. The caching framework includes an option to cache responses to anonymous (i.e., unauthenticated) clients. When the first anonymous req ... ttacker to obtain a valid CSRF cookie value and perform attacks which bypass the check for the cookie. To remedy this, the caching framework will no longer cache such responses. The heuristic for this will be: If the incoming request did not submit any ... ... ase, the browser will block the inline script or style (or report it for report-only configurations). Nonce generation and caching Django's nonce generation is lazy : the middleware only generates a nonce if {{ csp_nonce }} is accessed during template r ... ages that do not use nonces. However, because nonces must be unique per request, extra care is needed when using full-page caching (e.g., Django's cache middleware, CDN caching). Serving cached responses with previously generated nonces may result in re ... atch), reuse defeats the purpose of the nonce and weakens security. To ensure nonce-based policies remain effective: Avoid caching full responses that include {{ csp_nonce }} or csp_nonce_attr . If caching is necessary, use a strategy that injects a fre ... ... uration , so as to ensure that only modules the developer intended to be imported in this fashion can or will be imported. Caching of anonymous pages could reveal CSRF token Django includes both a caching framework and a system for preventing cross-site ... ust be sent by the client on future requests and, in forms, a hidden value which must be submitted back with the form. The caching framework includes an option to cache responses to anonymous (i.e., unauthenticated) clients. When the first anonymous req ... ttacker to obtain a valid CSRF cookie value and perform attacks which bypass the check for the cookie. To remedy this, the caching framework will no longer cache such responses. The heuristic for this will be: If the incoming request did not submit any ... ... .media %} Changed in Django 6.1: The csp_nonce_attr template tag was added, including support for rendering Media objects. Caching and Nonce Reuse The ContentSecurityPolicyMiddleware automatically handles generating a unique nonce and inserting the appr ... request and not served from cache. See the reference documentation on Nonce usage for implementation details and important caching considerations. ... ... ... ( #28876 ). Fixed incorrect foreign key constraint name for models with quoted db_table ( #28876 ). Fixed a regression in caching of a GenericForeignKey when the referenced model instance uses more than one level of multi-table inheritance ( #28856 ). ... ... ). Made query lookups for CICharField , CIEmailField , and CITextField use a citext cast ( #28702 ). Fixed a regression in caching of a GenericForeignKey when the referenced model instance uses multi-table inheritance ( #28856 ). Fixed "Cannot change co ... ... acle were subject to SQL injection, using a suitably crafted tolerance . バグ修正 Fixed a data loss possibility when using caching from async code ( #31253 ). Fixed a regression in Django 3.0 that caused a file response using a temporary file to be clos ... ... ed caching responses that set a cookie while varying on Cookie only when the incoming request contained no cookies at all. When the r ... 2026年10月08日