Replaced the (seemingly) obsolete COMPRESS setting with COMPRESS_ENABLED in the doc and commands help.
This commit is contained in:
@@ -61,7 +61,7 @@ class CompressorSettings(AppSettings):
|
|||||||
OFFLINE_CONTEXT = {}
|
OFFLINE_CONTEXT = {}
|
||||||
|
|
||||||
def configure_enabled(self, value):
|
def configure_enabled(self, value):
|
||||||
return value or getattr(global_settings, 'COMPRESS', value)
|
return value or getattr(global_settings, 'COMPRESS_ENABLED', value)
|
||||||
|
|
||||||
def configure_root(self, value):
|
def configure_root(self, value):
|
||||||
if value is None:
|
if value is None:
|
||||||
|
@@ -33,8 +33,8 @@ class Command(NoArgsCommand):
|
|||||||
'separate multiple extensions with commas, or use -e '
|
'separate multiple extensions with commas, or use -e '
|
||||||
'multiple times)'),
|
'multiple times)'),
|
||||||
make_option('-f', '--force', default=False, action='store_true',
|
make_option('-f', '--force', default=False, action='store_true',
|
||||||
help="Force generation of compressor content even if "
|
help="Force the generation of compressed content even if the "
|
||||||
"COMPRESS setting is not True.", dest='force'),
|
"COMPRESS_ENABLED setting is not True.", dest='force'),
|
||||||
make_option('--follow-links', default=False, action='store_true',
|
make_option('--follow-links', default=False, action='store_true',
|
||||||
help="Follow symlinks when traversing the COMPRESS_ROOT "
|
help="Follow symlinks when traversing the COMPRESS_ROOT "
|
||||||
"(which defaults to MEDIA_ROOT). Be aware that using this "
|
"(which defaults to MEDIA_ROOT). Be aware that using this "
|
||||||
@@ -211,7 +211,7 @@ class Command(NoArgsCommand):
|
|||||||
def handle_noargs(self, **options):
|
def handle_noargs(self, **options):
|
||||||
if not settings.COMPRESS_ENABLED and not options.get("force"):
|
if not settings.COMPRESS_ENABLED and not options.get("force"):
|
||||||
raise CommandError(
|
raise CommandError(
|
||||||
"Compressor is disabled. Set COMPRESS "
|
"Compressor is disabled. Set the COMPRESS_ENABLED "
|
||||||
"settting or use --force to override.")
|
"settting or use --force to override.")
|
||||||
if not settings.COMPRESS_OFFLINE:
|
if not settings.COMPRESS_OFFLINE:
|
||||||
if not options.get("force"):
|
if not options.get("force"):
|
||||||
|
@@ -6,15 +6,16 @@ Settings
|
|||||||
Django Compressor has a number of settings that control its behavior.
|
Django Compressor has a number of settings that control its behavior.
|
||||||
They've been given sensible defaults.
|
They've been given sensible defaults.
|
||||||
|
|
||||||
.. _compress:
|
.. _compress_enabled:
|
||||||
|
|
||||||
COMPRESS
|
COMPRESS_ENABLED
|
||||||
^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
:Default: the opposite of ``DEBUG``
|
:Default: the opposite of ``DEBUG``
|
||||||
|
|
||||||
Boolean that decides if compression will happen. In order to test compression
|
Boolean that decides if compression will happen. In order to test compression
|
||||||
when ``DEBUG`` is enabled COMPRESS needs to explicitly be set to ``True``.
|
when ``DEBUG`` is enabled COMPRESS_ENABLED needs to explicitly be set to
|
||||||
|
``True``.
|
||||||
|
|
||||||
.. _compress_url:
|
.. _compress_url:
|
||||||
|
|
||||||
|
@@ -48,13 +48,13 @@ Which would be rendered something like:
|
|||||||
|
|
||||||
Linked files **must** be accessible via :ref:`COMPRESS_URL <compress_url>`.
|
Linked files **must** be accessible via :ref:`COMPRESS_URL <compress_url>`.
|
||||||
|
|
||||||
If the :ref:`COMPRESS <compress>` setting is ``False`` (defaults to the
|
If the :ref:`COMPRESS_ENABLED <compress_enabled>` setting is ``False``
|
||||||
opposite of DEBUG) the ``compress`` template tag does nothing and simply returns
|
(defaults to the opposite of DEBUG) the ``compress`` template tag does nothing
|
||||||
exactly what it was given.
|
and simply returns exactly what it was given.
|
||||||
|
|
||||||
If both DEBUG and :ref:`COMPRESS <compress>` are set to ``True``, incompressible
|
If both DEBUG and :ref:`COMPRESS_ENABLED <compress_enabled>` are set to
|
||||||
files (off-site or non existent) will throw an exception. If DEBUG is ``False``
|
``True``, incompressible files (off-site or non existent) will throw an
|
||||||
these files will be silently stripped.
|
exception. If DEBUG is ``False`` these files will be silently stripped.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user