summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJarosław Wygoda <jaroslaw@wygoda.me>2021-06-02 21:44:59 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-08-05 12:40:34 +0200
commitd3c4696596822281c0a5d4b9e3ee27732a4ce092 (patch)
treea9cf2c603c8d9938a83132c0dcc1ac46eea125b5 /docs
parent4fe3774c729f3fd5105b3001fe69a70bdca95ac3 (diff)
Fixed #27590 -- Allowed customizing a manifest file storage in ManifestFilesMixin.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/staticfiles.txt20
-rw-r--r--docs/releases/4.0.txt5
2 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 14c739b3ea..46a73e7c54 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -313,6 +313,20 @@ For example, the ``'css/styles.css'`` file with this content:
@import url("../admin/css/base.27e20196a850.css");
+You can change the location of the manifest file by using a custom
+``ManifestStaticFilesStorage`` subclass that sets the ``manifest_storage``
+argument. For example::
+
+ from django.conf import settings
+ from django.contrib.staticfiles.storage import (
+ ManifestStaticFilesStorage, StaticFilesStorage,
+ )
+
+ class MyManifestStaticFilesStorage(ManifestStaticFilesStorage):
+ def __init__(self, *args, **kwargs):
+ manifest_storage = StaticFilesStorage(location=settings.BASE_DIR)
+ super().__init__(*args, manifest_storage=manifest_storage, **kwargs)
+
.. versionchanged:: 4.0
Support for finding paths in the source map comments was added.
@@ -320,6 +334,8 @@ For example, the ``'css/styles.css'`` file with this content:
Support for finding paths to JavaScript modules in ``import`` and
``export`` statements was added.
+ The ``manifest_storage`` argument was added.
+
.. attribute:: storage.ManifestStaticFilesStorage.max_post_process_passes
Since static files might reference other static files that need to have their
@@ -384,6 +400,10 @@ hashing algorithm.
Use this mixin with a custom storage to append the MD5 hash of the file's
content to the filename as :class:`~storage.ManifestStaticFilesStorage` does.
+.. versionchanged:: 4.0
+
+ The ``manifest_storage`` argument was added.
+
Finders Module
==============
diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt
index 390c561638..0fa87b2810 100644
--- a/docs/releases/4.0.txt
+++ b/docs/releases/4.0.txt
@@ -174,6 +174,11 @@ Minor features
replaces paths to JavaScript modules in ``import`` and ``export`` statements
with their hashed counterparts.
+* The new ``manifest_storage`` argument of
+ :class:`~django.contrib.staticfiles.storage.ManifestFilesMixin` and
+ :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`
+ allows customizing the manifest file storage.
+
:mod:`django.contrib.syndication`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~