Skip to content

sicarrots/pipeline-handlebars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Pipeline Handlebars

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 .

Installation

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',
)

Usage

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.

Inspired by

About

django-pipeline compiller for handlebars templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages