Commits

kmtr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 5cd5507

Fixed #17462: Adjusted staticfiles CachedFilesMixin code so its tests pass on Windows.

  • Participants
  • Parent commits 483d57a

Comments (0)

Files changed (1)

File django/contrib/staticfiles/storage.py

             cache_key = self.cache_key(name)
             hashed_name = self.cache.get(cache_key)
             if hashed_name is None:
-                hashed_name = self.hashed_name(name)
+                hashed_name = self.hashed_name(name).replace('\\', '/')
                 # set the cache if there was a miss (e.g. if cache server goes down)
                 self.cache.set(cache_key, hashed_name)
         return unquote(super(CachedFilesMixin, self).url(hashed_name))
             # Completely ignore http(s) prefixed URLs
             if url.startswith(('http', 'https')):
                 return matched
-            name_parts = name.split('/')
+            name_parts = name.split(os.sep)
             # Using posix normpath here to remove duplicates
             url = posixpath.normpath(url)
             url_parts = url.split('/')