Installation ============ * Install Django Compressor with your favorite Python package manager:: pip install django_compressor * Add ``'compressor'`` to your ``INSTALLED_APPS`` setting:: INSTALLED_APPS = ( # other apps "compressor", ) * See the list of :ref:`settings` to modify Django Compressor's default behaviour and make adjustements for your website. * In case you use Django 1.3's staticfiles_ contrib app (or its standalone clone django-staticfiles_) you have to add django_compressor's file finder to the ``STATICFILES_FINDERS`` setting:: STATICFILES_FINDERS = ( # other finders.. 'compressor.finders.CompressorFinder', ) .. _staticfiles: http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/ .. _django-staticfiles: http://pypi.python.org/pypi/django-staticfiles .. _dependencies: Dependencies ------------ BeautifulSoup_ ^^^^^^^^^^^^^^ for the default :ref:`parser ` ``compressor.parser.BeautifulSoupParser``:: pip install BeautifulSoup lxml_ (optional) ^^^^^^^^^^^^^^^^ for the optional :ref:`parser ` ``compressor.parser.LxmlParser``, also requires libxml2_:: STATIC_DEPS=true pip install lxml .. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ .. _lxml: http://codespeak.net/lxml/ .. _libxml2: http://xmlsoft.org/ Deprecation ----------- This section lists features and settings that are deprecated or removed in newer versions of Django Compressor. * ``COMPRESS_LESSC_BINARY`` Superseded by the :ref:`COMPRESS_PRECOMPILERS ` setting. Just make sure to use the correct mimetype when linking to less files or adding inline code and add the following to your settings:: COMPRESS_PRECOMPILERS = ( ('text/less', 'lessc {infile} {outfile}'), )