mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #28606 -- Deprecated CachedStaticFilesStorage.
This commit is contained in:
parent
55b0b766fb
commit
f892781b95
11 changed files with 58 additions and 41 deletions
|
@ -2,7 +2,7 @@ import os
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
|
||||
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
|
||||
from django.core.files import storage
|
||||
from django.utils import timezone
|
||||
|
||||
|
@ -70,18 +70,18 @@ class QueryStringStorage(storage.Storage):
|
|||
return path + '?a=b&c=d'
|
||||
|
||||
|
||||
class SimpleCachedStaticFilesStorage(CachedStaticFilesStorage):
|
||||
class SimpleStorage(ManifestStaticFilesStorage):
|
||||
|
||||
def file_hash(self, name, content=None):
|
||||
return 'deploy12345'
|
||||
|
||||
|
||||
class ExtraPatternsCachedStaticFilesStorage(CachedStaticFilesStorage):
|
||||
class ExtraPatternsStorage(ManifestStaticFilesStorage):
|
||||
"""
|
||||
A storage class to test pattern substitutions with more than one pattern
|
||||
entry. The added pattern rewrites strings like "url(...)" to JS_URL("...").
|
||||
"""
|
||||
patterns = tuple(CachedStaticFilesStorage.patterns) + (
|
||||
patterns = tuple(ManifestStaticFilesStorage.patterns) + (
|
||||
(
|
||||
"*.js", (
|
||||
(r"""(url\(['"]{0,1}\s*(.*?)["']{0,1}\))""", 'JS_URL("%s")'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue