mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28606 -- Deprecated CachedStaticFilesStorage.
This commit is contained in:
@@ -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")'),
|
||||
|
||||
Reference in New Issue
Block a user