Quickstart

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 Settings to modify Django Compressor’s default behaviour and make adjustments for your website.

  • In case you use Django’s staticfiles contrib app you have to add Django Compressor’s file finder to the STATICFILES_FINDERS setting, like this:

    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
        # other finders..
        'compressor.finders.CompressorFinder',
    )
    
  • Define COMPRESS_ROOT in settings if you don’t have already STATIC_ROOT or if you want it in a different folder.

Optional Dependencies