jQuery packaged in an handy django app to speed up new applications and deployment.
Project description
Requirements
Django 1.3 or later
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.js
Admin template customization:
{% extends "admin/base_site.html" %} {% block extrahead %} <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.js" /> {% 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-jquery-1.10.2.tar.gz
(36.2 kB
view details)
File details
Details for the file django-jquery-1.10.2.tar.gz
.
File metadata
- Download URL: django-jquery-1.10.2.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9e7552b14c517482c7b698e5256b7b9a8c90c65196c304dddbc2d22d0111a7 |
|
MD5 | a23ee49ffda515af7423adf4f1d4c1e7 |
|
BLAKE2b-256 | 09c9e899a9a9592da63d07d388905a5f905c9d2ea2b0c29040270d07686ff4e7 |