django-pipeline-handlebars is a compiler for django-pipeline.
This compiler will produce a JS using the widely used JST model.
It basically compiles and appends to the window.JST JSON array the template that you request (through django-pipeline) using for example Backbone.js or Spine.js .
Add repository url to your requirements or buildout.cfg, then run
pip install -r requirements
or
buildout
Add these lines in your django settings.py:
PIPELINE_JS = {
'application': {
'source_filenames': (
# Your other JS files...
'path/to/your/templates/*.html',#save your handlebars templates with html extension
),
'output_filename': 'js/application.js'
}
}
PIPELINE_COMPILERS = (
'pipeline_handlebars.compiler.HandlebarsCompiler',
)
If the paths are set correctly (try to play a bit depending on your static files situation), the handlebars templates will be compiled in a JS file and included automatically by pipeline.
- django-pipeline-eco (eco compiller for pipeline)