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.12.2.tar.gz
(37.2 kB
view details)
Built Distribution
File details
Details for the file django-jquery-1.12.2.tar.gz
.
File metadata
- Download URL: django-jquery-1.12.2.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99cebaa1f066550ffe1a4b149571287915a19dd2feef8632c1ee19f97738a0bb |
|
MD5 | a907ad9ae248c58509cd74d121d51649 |
|
BLAKE2b-256 | 79914db3d5d8b69d83b2e2efe69b13ca6970e0347fd223579002402c4a080901 |
File details
Details for the file django_jquery-1.12.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_jquery-1.12.2-py2.py3-none-any.whl
- Upload date:
- Size: 37.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 359c161fba3f0b993cce879a27777e91d19bbf25ac2452e966ca659dd8dcb4b1 |
|
MD5 | 7d2b92560f35a165777423fb2dad278b |
|
BLAKE2b-256 | d3de641b4775e25f19bd732c3a25544705976316f9593f298db8dc29a961e47f |