1
0
mirror of https://github.com/django/django.git synced 2024-12-24 10:05:46 +00:00

[5.0.x] Fixed #34813 -- Doc'd usage of integrity HTML attribute with ManifestStaticFilesStorage.

Backport of 116e225266 from main
This commit is contained in:
Patrick Rauscher 2023-09-04 20:32:21 +02:00 committed by Natalia
parent fd593db2fa
commit bf8aac3679

View File

@ -323,6 +323,16 @@ For example, the ``'css/styles.css'`` file with this content:
@import url("../admin/css/base.27e20196a850.css");
.. admonition:: Usage of the ``integrity`` HTML attribute with local files
When using the optional ``integrity`` attribute within tags like
``<script>`` or ``<link>``, its value should be calculated based on the
files as they are served, not as stored in the filesystem. This is
particularly important because depending on how static files are collected,
their checksum may have changed (for example when using
:djadmin:`collectstatic`). At the moment, there is no out-of-the-box
tooling available for this.
You can change the location of the manifest file by using a custom
``ManifestStaticFilesStorage`` subclass that sets the ``manifest_storage``
argument. For example::