🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

django-ember-precompile

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-ember-precompile

ember.js precompiler for projects that use the django compressor

1.9.0
latest
Source
npm
Version published
Weekly downloads
6
-25%
Maintainers
1
Weekly downloads
 
Created
Source

ember.js precompiler for projects that use the django compressor

##Why did you write another precompiler npm module?

  • django projects have a quick hook to execute code with django compressor
  • I prefer to precompile my handlebars templates for ember.js when possible
  • 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

Keywords

Ember.js

FAQs

Package last updated on 17 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts