django-jquery icondjango-jquery 1.8.3

jQuery packaged in an handy Django app
django-jquery is a Django app that packages jQuery to speed up new applications and deployment.

Installation

pip install django-jquery

Setup

Just add 'django.contrib.staticfiles' and 'jquery' to INSTALLED_APPS in your settings.py:

INSTALLED_APPS = (
 # ...

 'django.contrib.staticfiles',
 'jquery',

 # ...
)

Refer to Django static files documentation to configure and deploy static files.

Usage

You can refer to jquery in your template with:

{{STATIC_URL }}/js/jquery.css

Admin template customization:

{% extends "admin/base_site.html" %}

{% block extrahead %}
 < script type="text/javascript" src="{{STATIC_URL }}/js/jquery.css" / >
{% endblock %}


Custom widget:

class MyWidget(forms.TextInput):
 class Media:
 js = ('js/jquery.js',)

 def render(self, name, value, attrs=None):
 html = super(MyWidget, self).render(name, value, attrs=attrs)
 # ...
 return html

last updated on:
September 20th, 2012, 4:45 GMT
price:
FREE!
developed by:
Massimiliano Ravelli
license type:
MIT/X Consortium License 
category:
ROOT \ Internet \ Django Plugins

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT