Package: django-ember
Django EmberDjango Ember help integrates Ember.js in Django.
It useDjango.jsas base and is inspired from:Miguel Araujo’s verbatim snippet.Makina Corpus django-templatetag-handlebars.CompatibilityDjango Ember requires Python 2.6+, Django 1.4.2+ and Django.js 0.7.6+.InstallationYou can install Django Ember with pip:pip install django-emberor with easy_install:easy_install django-emberAdddjangojsandemberto yoursettings.INSTALLED_APPS.Django Ember depends onDjango.js. It will be installed by pip/easy_install.
If you want to useDjango.jsfeature, adddjangojsto yoursettings.INSTALLED_APPS.Template tagsLoading template tagsYou can either:load the template tag lib into each template manually:{% load ember %}load the template tag lib by adding to yourviews.py:from django.template import add_to_builtins

add_to_builtins('ember.templatetags.ember')JS Libraries templates tagsTagJS Library{% handlebars_js %}Handlebars.js(1.0.0-rc.4){% ember_js %}Ember.js(1.0.0-RC.6.1){% ember_data_js %}Ember Data(0.13-78-g9602df4){% tastypie_adapter_js %}Ember Data Tastypie Adapter(9db4b9a){% ember_full_js %}Ember.js + Handlebars.js + jQuery (optionnal){% emberpie_js %}Ember.js + Handlebars.js + jQuery (optionnal) + Ember Data + Tastypie AdapterExemple:<head>
{% ember_full_js %}
...
</head>Will render into insert the follwing JS lib script tags:Ember.jsHandlebars.jsjQueryjQuery loading is optionnal for{% ember_full_js %}and{% emberpie_js %}tags.
Simply setjquerykeyword to false:{% ember_full_js jquery=false %}
{% emberpie_js jquery=false %}Ifsettings.DEBUG=Truethe unminified versions of library is loaded
instead of the minified versions ifsettings.DEBUG=False.JS Template helpersDjango Ember the{% handlebars %}allow to easily write handlebars template for Ember.js.
Call the template tag, and write your Handlebars template:{% handlebars "tpl-infos" %}
    {{total}} {% trans "result(s)." %}
    <p>{% trans "Min" %}: {{min}}</p>
    <p>{% trans "Max" %}: {{max}}</p>
{% endhandlebars %}The following block will be rendered in your page:<script type="text/x-handlebars" data-template-name="tpl-infos">
    {{total}} result(s).
    <p>Min: {{min}}</p>
    <p>Max: {{max}}</p>
<script>There is a linkTo helper:<li class="nav">{% linkto "about" %}About{% endlinkto %}</li>The following block will be rendered in your page:<li class="nav">{{#linkTo "about"}}About{{/linkTo}}</li>When usingverbatimstyle tags sometimes it is hard to spot what
is Ember and what is Django; the purpose of this genericembertag is
making it easier.Usage:{% ember varname %}
{% ember #tagname arg1 "arg2" ... argn %} ... {% ember /tagname %}

{# example: #}
{% ember #if spam %}
     SPAM: {% ember spam %}
{% ember else %}
     No spam for you. Try with eggs.
{% ember /if %}This will render as:{{varname}}
{{#tagname arg1 "arg2" ... argn}} ... {{/tagname}}

{{#if spam}}
     SPAM: {{spam}}
{{else}}
     No spam for you. Try with eggs.
{{/if}}LICENSELesser GNU Public LicenseHandlebars.jsis released under the MIT license - Copyright 2011 Yehuda KatzChangelog0.3.1 (2013-07-30)Upgraded to Ember.js 1.0.0-RC.6.1Upgraded to Ember Data 0.13-78-g9602df4Downgraded to Handlebars to ensure compatibility until release0.3.0 (2013-06-07)Added template tag helperslinkToandember(thanks to Paulo Scardine)Upgraded to Ember.js 1.0.0-RC.5Upgraded to Ember Data 0.13Upgraded to latest Ember Data Tastypie Adapter (9db4b9a)Upgraded to Handlebars 1.0.0Python 2.6 support0.2.0 (2013-05-09)Depends on and extend django.jsUpgraded to Handlebars 1.0.0.rc.3Upgraded to Ember.js 1.0.0-RC.3-279-g41b62d7Upgraded to latest Ember Data git version (e33b544)Make jquery optionnal for{% ember_full_js %}and{% emberpie_js %}Support query string inTastypieAdapater(thanks to Peter Sutton/dj-foxxy)Provide both minified and unminified versions (triggered bysettings.DEBUG)Python 3 compatibleDjango 1.5 compatible0.1 (2012-08-06)Initial release