Python django.conf.settings.STATICFILES_STORAGE Examples

The following are 8 code examples of django.conf.settings.STATICFILES_STORAGE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.conf.settings , or try the search function .
Example #1
Source File: conftest.py    From ideascube with GNU Affero General Public License v3.0 6 votes vote down vote up
def pytest_configure(config):
    from django.conf import settings

    # This is already supposed to be the case by default, and we even tried
    # setting it explicitly anyway.
    #
    # But somehow, at the very beginning of the test suite (when running the
    # migrations or when the post_migrate signal is fired), the transient
    # database is on the filesystem (the value of NAME).
    #
    # We can't figure out why that is, it might be a bug in pytest-django, or
    # worse in django itself.
    #
    # Somehow the default database is always in memory, though.
    settings.DATABASES['transient']['TEST_NAME'] = ':memory:'

    # The documentation says not to use the ManifestStaticFilesStorage for
    # tests, and indeed if we do they fail.
    settings.STATICFILES_STORAGE = (
        'django.contrib.staticfiles.storage.StaticFilesStorage') 
Example #2
Source File: middleware.py    From django-cloudflare-push with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def storage_factory(collector):
    class DebugConfiguredStorage(LazyObject):
        def _setup(self):
            configured_storage_cls = get_storage_class(settings.STATICFILES_STORAGE)

            class DebugStaticFilesStorage(configured_storage_cls):

                def __init__(self, collector, *args, **kwargs):
                    super(DebugStaticFilesStorage, self).__init__(*args, **kwargs)
                    self.collector = collector

                def url(self, path):
                    self.collector.collect(path)
                    return super(DebugStaticFilesStorage, self).url(path)

            self._wrapped = DebugStaticFilesStorage(collector)
    return DebugConfiguredStorage 
Example #3
Source File: storage.py    From GTDWeb with GNU General Public License v2.0 5 votes vote down vote up
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
Example #4
Source File: storage.py    From bioforum with MIT License 5 votes vote down vote up
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
Example #5
Source File: storage.py    From Hands-On-Application-Development-with-PyCharm with MIT License 5 votes vote down vote up
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
Example #6
Source File: storage.py    From openhgsenti with Apache License 2.0 5 votes vote down vote up
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
Example #7
Source File: storage.py    From python2017 with MIT License 5 votes vote down vote up
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
Example #8
Source File: collectstatic.py    From django-cloudinary-storage with MIT License 5 votes vote down vote up
def copy_file(self, path, prefixed_path, source_storage):
        """
        Overwritten to execute only with --upload-unhashed-files param or StaticCloudinaryStorage.
        Otherwise only hashed files will be uploaded during postprocessing.
        """
        if (settings.STATICFILES_STORAGE == 'cloudinary_storage.storage.StaticCloudinaryStorage' or
                self.upload_unhashed_files):
            super(Command, self).copy_file(path, prefixed_path, source_storage)