diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-03-13 03:48:11 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-03-13 03:48:11 +0000 |
| commit | 0ee801e3603218a3c3a8c0adbc94f69e40523ee2 (patch) | |
| tree | b240acea8add1ed8b3424688953baf0e8b01b8de /django | |
| parent | 7487c74020f97829e466c7efbdf7bd9e5fa90b1b (diff) | |
Fixed #17857 -- Stopped CachedStaticFilesStorage from creating absolute URLs unnecessarily. Thanks, tgecho.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/staticfiles/storage.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py index 67ce5dccee..c000f97d05 100644 --- a/django/contrib/staticfiles/storage.py +++ b/django/contrib/staticfiles/storage.py @@ -165,9 +165,11 @@ class CachedFilesMixin(object): start, end = 1, sub_level - 1 joined_result = '/'.join(name_parts[:-start] + url_parts[end:]) hashed_url = self.url(unquote(joined_result), force=True) + file_name = hashed_url.split('/')[-1:] + relative_url = '/'.join(url.split('/')[:-1] + file_name) - # Return the hashed and normalized version to the file - return 'url("%s")' % unquote(hashed_url) + # Return the hashed version to the file + return 'url("%s")' % unquote(relative_url) return converter def post_process(self, paths, dry_run=False, **options): |
