2011-01-08 10:03:27 +00:00
|
|
|
from datetime import datetime
|
2015-01-28 12:35:27 +00:00
|
|
|
|
2012-05-16 11:21:46 +00:00
|
|
|
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
|
2015-01-28 12:35:27 +00:00
|
|
|
from django.core.files import storage
|
2016-02-09 15:00:14 +00:00
|
|
|
from django.utils import timezone
|
2011-01-08 10:03:27 +00:00
|
|
|
|
2013-11-02 21:34:05 +00:00
|
|
|
|
2011-01-08 10:03:27 +00:00
|
|
|
class DummyStorage(storage.Storage):
|
|
|
|
"""
|
2016-02-09 15:00:14 +00:00
|
|
|
A storage class that implements get_modified_time().
|
2011-01-08 10:03:27 +00:00
|
|
|
"""
|
|
|
|
def _save(self, name, content):
|
|
|
|
return 'dummy'
|
|
|
|
|
|
|
|
def delete(self, name):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def exists(self, name):
|
|
|
|
pass
|
|
|
|
|
2016-02-09 15:00:14 +00:00
|
|
|
def get_modified_time(self, name):
|
|
|
|
return datetime.datetime(1970, 1, 1, tzinfo=timezone.utc)
|
2012-05-16 11:21:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SimpleCachedStaticFilesStorage(CachedStaticFilesStorage):
|
|
|
|
|
|
|
|
def file_hash(self, name, content=None):
|
|
|
|
return 'deploy12345'
|