Django compressor ================= Compresses linked and inline javascript or CSS into a single cached file. Syntax: .. code-block:: django {% load compress %} {% compress %} {% endcompress %} Examples: .. code-block:: django {% load compress %} {% compress css %} {% endcompress %} Which would be rendered something like: .. code-block:: html or: .. code-block:: django {% load compress %} {% compress js %} {% endcompress %} Which would be rendered something like: .. code-block:: html Linked files must be on your COMPRESS_URL (which defaults to MEDIA_URL). If DEBUG is true off-site files will throw exceptions. If DEBUG is false they will be silently stripped. If COMPRESS is False (defaults to the opposite of DEBUG) the compress tag simply returns exactly what it was given, to ease development. .. note:: For production sites it is advisable to use a real cache backend such as memcached to speed up the checks of compressed files. Make sure you set your Django cache backend appropriately. CSS Notes: ********** All relative ``url()`` bits specified in linked CSS files are automatically converted to absolute URLs while being processed. Any local absolute URLs (those starting with a ``'/'``) are left alone. Stylesheets that are ``@import``'d are not compressed into the main file. They are left alone. If the media attribute is set on