Skip to content

Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.

License

Notifications You must be signed in to change notification settings

gabrielelucci/django-static-precompiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Static Precompiler

Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.

Build Status Documentation Gitter

Documentation

Documentation is available at http://django-static-precompiler.readthedocs.io.

Install

pip install django-static-precompiler

Use in templates

{% load compile_static %}
{% load static %}

<script src="{% static "path/to/script.coffee"|compile %}"></script>
<link rel="stylesheet" href="{% static "path/to/styles1.less"|compile %}" />
<link rel="stylesheet" href="{% static "path/to/styles2.scss"|compile %}" />

Use in Python

>>> from static_precompiler.utils import compile_static
>>> compile_static("styles.scss")
"COMPILED/styles.css"

Python compatibility

Python 3.5+ is required.

Django compatibility

django-static-precompiler Django
version 3.x 2.x 1.11 1.10 1.9 1.8 1.7 1.6
2.0+ + + + + +      
1.7-1.8   + + + + + +  
1.6     + + + + +  
1.5       + + + + +
1.1-1.4         + + + +
1.0             + +

About

Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.6%
  • Makefile 0.4%
  • SCSS 0.3%
  • Dockerfile 0.2%
  • Less 0.2%
  • CoffeeScript 0.1%
  • Other 0.2%