This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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.

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"

Changes

1.5

  • Add support for Django 1.10 and Python 3.5
  • Improve support for load_paths setting in SCSS/SASS compilers.

1.4

  • Fix the run_command utility function to rely on process return code rather than stderr to determine if compilation has finished successfully. WARNING! Changes in run_command are backward incompatible. If you use this function in your custom compiler you should update your code.

1.3.1

  • Add support for --presets option in Babel compiler. See babel-cli options <https://babeljs.io/docs/usage/options/> for more information.

1.3

  • Fix Stylus compiler to actually enable support for detecting changes in imported files
  • Add precision option to SASS / SCSS / LibSass compilers. Set it to 8 or more if you compile Bootstrap.
  • Add output_style option to SASS / SCSS / LibSass compilers.
  • Enable verbose output for compilestatic management command

1.2

  • Add LiveScript compiler
  • Add support for --global-var option in LESS compiler
  • Add SCSS / SASS compiler based on Libsass

1.1

  • Add source maps support for SASS/SCSS
  • Add source maps support for LESS
  • Add source maps support for CoffeeScript
  • Add source maps support for Stylus
  • Add source maps support for Babel
  • Add Handlebars compiler
  • Add support for Django 1.9
  • Add plugins parameter to Babel compiler
  • Add load_paths parameter to SASS/SCSS compilers

1.0.1

  • Add modules parameter to Babel compiler
  • Allow to install Watchdog with pip install django-static-precompiler[watch]

1.0

  • Add compile template filter
  • Deprecate {% compile %} template tag
  • The following compiler specific template tags are REMOVED:
    • {% coffeescript %}
    • {% inlinecoffeescript %}
    • {% sass %}
    • {% inlinesass %}
    • {% scss %}
    • {% inlinescss %}
    • {% less %}
    • {% inlineless %}
  • Add Stylus compiler

0.9

  • Compiler options are specified with STATIC_PRECOMPILER_COMPILERS setting.
  • The following settings are DEPRECATED:
    • COFFEESCRIPT_EXECUTABLE
    • SCSS_EXECUTABLE
    • SCSS_USE_COMPASS
    • LESS_EXECUTABLE
  • -C (--no-cache) flag is removed from SASS/SCSS compilers
  • Add STATIC_PRECOMPILER_LIST_FILES setting
  • Add Babel compiler

0.8

  • Add {% inlinecompile %} template tag
  • The following compiler specific template tags are DEPRECATED:
    • {% coffeescript %}
    • {% inlinecoffeescript %}
    • {% sass %}
    • {% inlinesass %}
    • {% scss %}
    • {% inlinescss %}
    • {% less %}
    • {% inlineless %}
  • Use Django 1.7 migrations
  • BUGFIX: fix sass imports from scss and vice versa
  • BUGFIX: make sure that compilestatic works if watchdog isn’t installed.
  • BUGFIX: fix compilation error when dependency file was removed or renamed

0.7

  • Add compilestatic management command (replaces static_precompiler_watch)
  • Add STATIC_PRECOMPILER_DISABLE_AUTO_COMPILE to settings
  • Add STATIC_PRECOMPILER_CACHE_NAME to settings
  • Bugfixes

0.6

  • Add STATIC_PRECOMPILER_PREPEND_STATIC_URL to settings
  • Add {% compile %} template tag

0.5.3

  • Update the parsing of @import statements. Fix the bug with URLs containing commas.

0.5.2

  • static_precompiler_watch: watch for changes in all directories handled by static finders, not only STATIC_ROOT
  • static_precompiler_watch: add --no-initial-scan option

0.5.1

  • Fix SCSS compilation error when importing Compass styles

0.5

  • Add Python 3 support

0.4

  • Add compile_static and compile_static_lazy utility functions.

0.3

  • Bug fixes
  • Add Windows compatibility

0.2

  • Reduce the max length of varchar fields in Dependency model to meet MySQL limitations
  • static_precompiler_watch: don’t fall with exception on compilation errors or if source file is not found

0.1

  • Initial release
Release History

Release History

1.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-static-precompiler-1.5.tar.gz (28.3 kB) Copy SHA256 Checksum SHA256 Source Sep 26, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting