Welcome to djquery’s documentation!

djquery is an app to make it easy to manage jquery dependencies and common uses. It bundles all recent jquery core and ui libs, and makes it easy to include on templates.

djquery does not work on the backend or try it, it’s fully focus on help template designers to bootstrap easy and fast.

Installation

To easily install djquery, please use

sudo pip install djquery.

If you don’t want to use pip, download the latest version from pypi, unpack the tarball and run sudo python setup.py install if you want a wide system install.

djquery uses django-classy-tags and works for Django 1.3 or superior.

Later add djquery to your INSTALLED_APPS on your settings.py file

Usage

Include the libraries

Having this template

{% load jquery_tags %}
{% jquery_core_load %}
{% jquery_ui_load %}

Will output

<script type="text/javascript" src="/static/django_jquery/jquery-1.6.min.js"></script>
<link rel="stylesheet" href="/static/django_jquery/ui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
<script type="text/javascript" src="/static/django_jquery/ui/1.8.16/jquery-ui-min.js"></script>

The template tags from jquery_tags has this optiosn:

jquery_core_load

{% jquery_core_load version %} renders the script tag for the jquery core library. It takes one param to describe the version, by default use the most recent version available.

For example

{% jquery_core_load 1.5 %}

Will output

<script type="text/javascript" src="/static/django_jquery/jquery-1.6.min.js"></script>

jquery_ui_load

{% jquery_ui_load version %} renders the script tag for the jquery core library. It takes one param to describe the version, the same as jquery_core_load use the most recent version available by default.

For example

{% jquery_ui_load 1.7 %}

Will output

<link rel="stylesheet" href="/static/django_jquery/ui/1.7.0/themes/base/jquery-ui.css" type="text/css" media="all" />
<script type="text/javascript" src="/static/django_jquery/ui/1.7.0/jquery-ui-min.js"></script>

Indices and tables