当前位置: 首页>>代码示例>>Python>>正文


Python settings.STATICFILES_STORAGE属性代码示例

本文整理汇总了Python中django.conf.settings.STATICFILES_STORAGE属性的典型用法代码示例。如果您正苦于以下问题:Python settings.STATICFILES_STORAGE属性的具体用法?Python settings.STATICFILES_STORAGE怎么用?Python settings.STATICFILES_STORAGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在django.conf.settings的用法示例。


在下文中一共展示了settings.STATICFILES_STORAGE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pytest_configure

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import STATICFILES_STORAGE [as 别名]
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') 
开发者ID:ideascube,项目名称:ideascube,代码行数:22,代码来源:conftest.py

示例2: storage_factory

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import STATICFILES_STORAGE [as 别名]
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 
开发者ID:skorokithakis,项目名称:django-cloudflare-push,代码行数:19,代码来源:middleware.py

示例3: _setup

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import STATICFILES_STORAGE [as 别名]
def _setup(self):
        self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)() 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:4,代码来源:storage.py

示例4: copy_file

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import STATICFILES_STORAGE [as 别名]
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) 
开发者ID:klis87,项目名称:django-cloudinary-storage,代码行数:10,代码来源:collectstatic.py


注:本文中的django.conf.settings.STATICFILES_STORAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。