jquery打包在一个方便的django应用程序中,以加速新的应用程序和部署。
static-jquer的Python项目详细描述
安装
$ pip install static-jquery $ pip install static-jquery==3.2.1.0
设置
只需将'django.contrib.staticfiles'和'jquery'添加到 已在您的设置中安装应用程序。py:
INSTALLED_APPS = ( # ... 'django.contrib.staticfiles', 'jquery', # ... )
请参阅djangostatic files文档以配置和部署 静态文件。
用法
您可以使用以下命令引用模板中的jquery:
{% load jquery %} {% jquery_js %} or {% jquery_js 3.2.1.0 %}