howtodothis
howtodothis

Reputation: 1295

How to make Django Compressor work with LessCSS on Windows

I'd like to know how I can make Django Compressor work with LessCSS on Windows.

lessc is installed

C:\>lessc
    dotless Compiler 1.1.0.7
    Compiles .less files to css files.

Django Pipeline Settings

COMPRESS_PRECOMPILERS = ( ('text/less', 'lessc {infile} {outfile}'), )

Upvotes: 2

Views: 2113

Answers (2)

Bite code
Bite code

Reputation: 596833

If you use the ruby version of less (and not the nodejs version), then you should use:

COMPRESS_PRECOMPILERS = (
    ('text/less', 'lessc {infile}'),
)

and not

COMPRESS_PRECOMPILERS = (
    ('text/less', 'lessc {infile} {outfile}'),
)

Upvotes: 1

ssbb
ssbb

Reputation: 2025

Try this:

COMPRESS_PRECOMPILERS = (
    ('text/less', 'lessc {infile} {outfile}'),
)

And this in your template:

{% load compress %}

{% compress css %}
<link type="text/less" rel="stylesheet" href="/static/css/styles.less" charset="utf-8">
{% endcompress %}

Upvotes: 7

Related Questions