diff options
| author | Jarosław Wygoda <jaroslaw@wygoda.me> | 2021-06-02 21:44:59 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-08-05 12:40:34 +0200 |
| commit | d3c4696596822281c0a5d4b9e3ee27732a4ce092 (patch) | |
| tree | a9cf2c603c8d9938a83132c0dcc1ac46eea125b5 /docs/ref | |
| parent | 4fe3774c729f3fd5105b3001fe69a70bdca95ac3 (diff) | |
Fixed #27590 -- Allowed customizing a manifest file storage in ManifestFilesMixin.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/staticfiles.txt | 20 |
1 files changed, 20 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 ============== |
