summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2022-12-29 16:52:56 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-02 09:53:52 +0100
commitafa2e28205fe708334ad463b6d3b0e9960b945a6 (patch)
treedd04d81ebdaca8ab8c38f37f5c221923e67cf7cf /docs
parent75500feecddcb27b6ab65c9057e7317024cef761 (diff)
Fixed #34235 -- Added ManifestFilesMixin.manifest_hash attribute.
This adds ManifestFilesMixin.manifest_hash attribute exposing a "hash" of the full manifest. This allows applications to determine when their static files have changed.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/staticfiles.txt8
-rw-r--r--docs/releases/4.2.txt4
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 0f0e8d8001..7ca3584c33 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -336,6 +336,14 @@ argument. For example::
Support for finding paths to JavaScript modules in ``import`` and
``export`` statements was added.
+.. attribute:: storage.ManifestStaticFilesStorage.manifest_hash
+
+.. versionadded:: 4.2
+
+This attribute provides a single hash that changes whenever a file in the
+manifest changes. This can be useful to communicate to SPAs that the assets on
+the server have changed (due to a new deployment).
+
.. attribute:: storage.ManifestStaticFilesStorage.max_post_process_passes
Since static files might reference other static files that need to have their
diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt
index 826545f444..6d2fb32644 100644
--- a/docs/releases/4.2.txt
+++ b/docs/releases/4.2.txt
@@ -201,6 +201,10 @@ Minor features
replaces paths to JavaScript modules in ``import`` and ``export`` statements
with their hashed counterparts.
+* The new :attr:`.ManifestStaticFilesStorage.manifest_hash` attribute provides
+ a hash over all files in the manifest and changes whenever one of the files
+ changes.
+
:mod:`django.contrib.syndication`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~