Skip to main content
https://codecov.io/gh/orus-io/django-compressor-mako/branch/master/graph/badge.svg https://travis-ci.org/orus-io/django-compressor-mako.svg?branch=master https://img.shields.io/pypi/v/django_compressor_mako.svg

This module provide mako template support for Django Compressor.

Usage

All you need to do is to import extension namespace and using it with mako syntax:

<%namespace name="compress" module="django_compressor_mako"/>

<%compress:compress kind="css">
<link rel="stylesheet" href="/static/css/style.css" type="text/css" />
</%compress:compress>

Almost all django-compressor arguments are supported but must be explicitly named:

  • kind: mandatory, “css” or “js”.

  • mode: optional, compressor mode, “file” or “inline”.

  • name: is not supported and will raise a NotImplementedError

Outputs cannot be named and are just named using hash plus extension.

Also note that mako template doesn’t allow blocks inside of <%call>, that means you cannot use the following syntax:

<%namespace name="compress" module="django_compressor_mako"/>

<%compress:compress kind="css">
<%block name="more_css"/>
</%compress:compress>

Offline compression

In order to use offline compression you must first create cached compressed files and manifest using python ./manage.py compress_mako.

Shorter functions

Additionally two shorter functions are provided, css and js, same arguments can be passed except kind which is set by default depending on which one is used, eg.:

<%namespace name="compress" module="django_compressor_mako"/>

<%compress:css>
<link rel="stylesheet" href="/static/css/style.css" type="text/css" />
</%compress:css>

<%compress:js>
<script type="text/javascript" src="/static/js/script.js">
</%compress:js>

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_compressor_mako-1.2.0.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file django_compressor_mako-1.2.0.tar.gz.

File metadata

File hashes

Hashes for django_compressor_mako-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2cab7d36bcfe97560029a40efb40c57f7966e1eb1ae426f3e1d41bc29663979e
MD5 bc3b78941b897c332bcae889b2e3c70c
BLAKE2b-256 1c2bfe0271709c4e3400fc0af982d977523623ada29b86d67bea949dfc36cf0c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 file

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.1

1 file

1.0.0

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page