Django-compressor

Latest version: v4.4

Safety actively analyzes 625610 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 6

1.3

-----------------

- *Backward incompatible changes*

- Dropped support for Python 2.5. Removed ``any`` and ``walk`` compatibility
functions in ``compressor.utils``.

- Removed compatibility with some old django setttings:

- :attr:`~COMPRESS_ROOT` no longer uses ``MEDIA_ROOT`` if ``STATIC_ROOT`` is
not defined. It expects ``STATIC_ROOT`` to be defined instead.

- :attr:`~COMPRESS_URL` no longer uses ``MEDIA_URL`` if ``STATIC_URL`` is
not defined. It expects ``STATIC_URL`` to be defined instead.

- :attr:`~COMPRESS_CACHE_BACKEND` no longer uses ``CACHE_BACKEND`` and simply
defaults to ``default``.

- Added precompiler class support. This enables you to write custom precompilers
with Python logic in them instead of just relying on executables.

- Made CssAbsoluteFilter smarter: it now handles URLs with hash fragments or
querystring correctly. In addition, it now leaves alone fragment-only URLs.

- Removed a ``fsync()`` call in ``CompilerFilter`` to improve performance.
We already called ``self.infile.flush()`` so that call was not necessary.

- Added an extension to provide django-sekizai support.
See :ref:`django-sekizai Support <django-sekizai_support>` for more
information.

- Fixed a ``DeprecationWarning`` regarding the use of ``django.utils.hashcompat``

- Updated bundled ``rjsmin.py`` to fix some JavaScript compression errors.

1.2

----

- Added compatibility with Django 1.4 and dropped support for Django 1.2.X.

- Added contributing docs. Be sure to check them out and start contributing!

- Moved CI to Travis: http://travis-ci.org/django-compressor/django-compressor

- Introduced a new ``compressed`` context dictionary that is passed to
the templates that are responsible for rendering the compressed snippets.

This is a **backwards-incompatible change** if you've overridden any of
the included templates:

- ``compressor/css_file.html``
- ``compressor/css_inline.html``
- ``compressor/js_file.html``
- ``compressor/js_inline.html``

The variables passed to those templates have been namespaced in a
dictionary, so it's easy to fix your own templates.

For example, the old ``compressor/js_file.html``::

<script type="text/javascript" src="{{ url }}"></script>

The new ``compressor/js_file.html``::

<script type="text/javascript" src="{{ compressed.url }}"></script>

- Removed old templates named ``compressor/css.html`` and
``compressor/js.html`` that were originally left for backwards
compatibility. If you've overridden them, just rename them to
``compressor/css_file.html`` or ``compressor/js_file.html`` and
make sure you've accounted for the backwards incompatible change
of the template context mentioned above.

- Reverted an unfortunate change to the YUI filter that prepended
``'java -jar'`` to the binary name, which doesn't alway work, e.g.
if the YUI compressor is shipped as a script like
``/usr/bin/yui-compressor``.

- Changed the sender parameter of the :func:`~compressor.signals.post_compress`
signal to be either :class:`compressor.css.CssCompressor` or
:class:`compressor.js.JsCompressor` for easier customization.

- Correctly handle offline compressing files that are found in ``{% if %}``
template blocks.

- Renamed the second option for the ``COMPRESS_CSS_HASHING_METHOD`` setting
from ``'hash'`` to ``'content'`` to better describe what it does. The old
name is also supported, as well as the default being ``'mtime'``.

- Fixed CssAbsoluteFilter, ``src`` attributes in includes now get transformed.

- Added a new hook to allow developers to completely bypass offline
compression in CompressorNode subclasses: ``is_offline_compression_enabled``.

- Dropped versiontools from required dependencies again.

1.1.2

------

- Fixed an installation issue related to versiontools.

1.1.1

------

- Fixed a stupid ImportError bug introduced in 1.1.

- Fixed Jinja2 docs of since ``JINJA2_EXTENSIONS`` expects
a class, not a module.

- Fixed a Windows bug with regard to file resolving with
staticfiles finders.

- Stopped a potential memory leak when memoizing the rendered
output.

- Fixed the integration between staticfiles (e.g. in Django <= 1.3.1)
and compressor which prevents the collectstatic management command
to work.

.. warning::

Make sure to **remove** the ``path`` method of your custom
:ref:`remote storage <remote_storages>` class!

1.1

----

- Made offline compression completely independent from cache (by writing a
manifest.json file).

You can now easily run the ``compress`` management command locally and
transfer the :attr:`~django.conf.settings.COMPRESS_ROOT` dir to your server.

- Updated installation instructions to properly mention all dependencies,
even those internally used.

- Fixed a bug introduced in 1.0 which would prevent the proper deactivation
of the compression in production.

- Added a Jinja2_ :doc:`contrib extension </jinja2>`.

- Made sure the rel attribute of link tags can be mixed case.

- Avoid overwriting context variables needed for compressor to work.

- Stopped the compress management command to require model validation.

- Added missing imports and fixed a few :pep:`8` issues.

.. _Jinja2: http://jinja.pocoo.org/2/

1.0.1

------

- Fixed regression in ``compressor.utils.staticfiles`` compatibility
module.

Page 4 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.