Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage | ||
from django.contrib.staticfiles.storage import ManifestFilesMixin | ||
|
||
|
||
class CompactManifestStaticFilesStorage(ManifestStaticFilesStorage): | ||
|
||
def post_process(self, *args, **kwargs): | ||
""" | ||
Based on django post_process from ManifestStaticFilesStorage | ||
""" | ||
all_post_processed = super(ManifestFilesMixin, | ||
self).post_process(*args, **kwargs) | ||
for post_processed in all_post_processed: | ||
yield post_processed | ||
self.save_manifest() | ||
for original_file in self.hashed_files: | ||
self.delete(original_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version": "1.0", "paths": {"test_hash.jpg": "test_hash.11aa22bb33cc.jpg"}} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters