1.9.0 • Published 9 years ago

django-ember-precompile v1.9.0

Weekly downloads
3
License
-
Repository
github
Last release
9 years ago

ember.js precompiler for projects that use the django compressor

##Why did you write another precompiler npm module?

  1. django projects have a quick hook to execute code with django compressor
  2. I prefer to precompile my handlebars templates for ember.js when possible
  3. I couldn't find an existing npm module that was built to work with django compressor and ember.js

##How do I get started then?

First you need to install node.js if you have not already

http://nodejs.org/download/

Install the npm module

npm install django-ember-precompile

Add django compressor to your django web project

pip install -r django_compressor

Register a type to have the compressor fire off the precompile step (in your settings.py)

COMPRESS_PRECOMPILERS = (
    ('text/x-handlebars', 'node_modules/django-ember-precompile/bin/django-ember-precompile {infile}'),
)

Finally in your html you need to reference the uncompiled handlebars templates

{% load staticfiles %}
{% load compress %}

{% compress js %}
<script src="{% static 'script/app/templates/foo.handlebars' %}" type="text/x-handlebars"></script>
{% endcompress %}

This npm module makes a few assumptions to correctly register the template name with ember.js

1.) Each template must have a file extension of "handlebars" or "hbs"
2.) Each template must reside under a root "templates" directory

##Development

To run the tests

cd tests
./runner.sh
1.9.0

9 years ago

1.7.0

10 years ago

1.6.1

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.2

11 years ago

1.0.9

11 years ago

1.0.8

11 years ago

1.0.7

11 years ago

1.0.6

11 years ago

1.0.5

11 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago