Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Stopped the collectstatic management from being wastful with file han…

…dlers. Refs r17519.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17521 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 803de60c088e7a439b5549575e1e3a082ae26d54 1 parent bd13cfa
@jezdez jezdez authored
View
2  django/contrib/staticfiles/management/commands/collectstatic.py
@@ -107,7 +107,7 @@ def collect(self):
prefixed_path = os.path.join(storage.prefix, path)
else:
prefixed_path = path
- found_files[prefixed_path] = storage.open(path)
+ found_files[prefixed_path] = (storage, path)
handler(path, prefixed_path, storage)
# Here we check if the storage backend has a post_process
View
3  django/contrib/staticfiles/storage.py
@@ -198,7 +198,8 @@ def post_process(self, paths, dry_run=False, **options):
# use the original, local file, not the copied-but-unprocessed
# file, which might be somewhere far away, like S3
- with paths[name] as original_file:
+ storage, path = paths[name]
+ with storage.open(path) as original_file:
# generate the hash with the original content, even for
# adjustable files.
View
4 docs/ref/contrib/staticfiles.txt
@@ -281,8 +281,8 @@ StaticFilesStorage
.. versionadded:: 1.4
This method is called by the :djadmin:`collectstatic` management command
- after each run and gets passed the paths of found files, as well as the
- command line options.
+ after each run and gets passed the local storages and paths of found
+ files as a dictionary, as well as the command line options.
The :class:`~django.contrib.staticfiles.storage.CachedStaticFilesStorage`
uses this behind the scenes to replace the paths with their hashed
Please sign in to comment.
Something went wrong with that request. Please try again.