Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Compresses linked and inline javascript or CSS into a single cached file.

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 compressor
Octocat-spinner-32 docs
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 LICENSE
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.md
Octocat-spinner-32 README.rst
Octocat-spinner-32 setup.py
Octocat-spinner-32 tox.ini
README.md

Django Compressor with Compass project support

Added comprass template tag to merge django-compressor behaviour with precompile compass files. It differs with CompassFilter in the structure of statics in project.

While with CompassFilter you link each *.sass/*.scss files and force to compress (because need precompile), with comprass tag you link each *.css files like you would do with normal projects and compile compass project before compressor and render.

Philosofy behind that is a good structure of statics and config compass file

NEED generate a compass project with compass create or edit manually config.rb inside COMPRESSOR_ROOT (staticfiles)

You can create subdirs but need link config.rb with COMPASS_CONFIG setting

Example

config.rb

Created by compass create or manually. Attach static structure dir See @doc: http://compass-style.org

Dir structure inside STATIC_ROOT (django 1.3)

/compass/print.sass
        /screen.sass
 config.rb
/css/print.css
    /screen.css
    /extra.css

Note: Of course css dir is populate by compass

Template example

{% comprass %}
  <link href="{{ STATIC_PREFIX }}css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_PREFIX }}css/print.css" media="print" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_PREFIX }}css/extra.css" media="print" rel="stylesheet" type="text/css" />
  <style type="text/css">
    * { color: red !important; }
  </style>
{% endcomprass %}

Settings config

COMPASS_ENABLED [default: DEBUG]

COMPASS_CONFIG [default: 'config.rb']
Compass config file inside COMPRESS_ROOT

COMPASS_WHERE [default: basename(COMPASS_CONFIG)]
Where compass compile will be execute, attached to config compass file

COMPASS_BINARY [default: 'compass']
Something went wrong with that request. Please try again.