django intercoolerjs
1.0.0
django-intercooler.js 只是 intercooler.js 的 Django 包裝器。
Django 1.3 或更高版本
$ pip install django-intercoolerjs
只需將'django.contrib.staticfiles'
和'intercoolerjs'
添加到 settings.py 中的 INSTALLED_APPS 中
INSTALLED_APPS = (
# ...
'django.contrib.staticfiles' ,
'intercoolerjs' ,
# ...
)
請參閱 Django 靜態文件文件來配置和部署靜態文件。
您可以像這樣在 Django 模板中使用 intercooler.js
{% load static %}
<!-- only if you also need jQuery -->
<script src="{% static "intercoolerjs/js/jquery.js" %}"></script>
<!-- this is the minified intercooler.js -->
<script src="{% static "intercoolerjs/js/intercooler.min.js" %}"></script>
從 intercooler.js 版本 1.1.0 開始,也可以使用 zepto 作為 jQuery 的替代品。 zepto 尚未與 django-intercoolerjs 捆綁在一起。
我們保留 intercooler.js 版本號,以便在 django-intercoolerjs 中輕鬆發現 intercooler.js 版本。但是,由於我們還需要版本號,因此新增了另一個點號。
如果intercooler.js版本為1.0.3。是目前版本,django-intercoolerjs 的版本號碼為 1.0.3.0。最後一個數字將隨著 django-intercoolerjs 的每個版本而增加。
可以在'demo'
資料夾中找到演示項目以及自述文件。