Skip to content

Instantly share code, notes, and snippets.

@eyeseast
Created March 23, 2012 16:28
Show Gist options
  • Save eyeseast/2172461 to your computer and use it in GitHub Desktop.
Save eyeseast/2172461 to your computer and use it in GitHub Desktop.
LESS + Django Compressor
{# via http://www.caktusgroup.com/blog/2012/03/05/using-less-django/ #}
{% load compress %}
{% if debug %}
// This is the client-side way to compile less and an ok choice for local dev
<link rel="stylesheet/less" type="text/css" media="all" href="{{ STATIC_URL }}less/style.less" />
<script src="{{ STATIC_URL }}js/less-1.1.3.min.js"></script>
{% else %}
{% compress css %}
// This is the nifty django-compressor way to compile your less files in css
<link rel="stylesheet" type="text/less" media="all" href="{{ STATIC_URL }}less/style.less" />
{% endcompress %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment