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
Release files for django-jquery 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-jquery-3.1.0.tar.gz | 33.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_jquery-3.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 67.4 kB
Release files / django-jquery-3.1.0.tar.gz
| Download URL | django-jquery-3.1.0.tar.gz |
|---|---|
| Size | 33.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
414ac1083708ac71cc771612e7287702c939d06cd357fd53bb1271a4f6255115
|
|
BLAKE2b-256 checksum How to use checksums |
76bebc377f2d9406f9e2e0b483fc69df04fe5a7780802b42fb64b8f2a9cc52e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_jquery-3.1.0-py2.py3-none-any.whl
| Download URL | django_jquery-3.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 33.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e7e2ac14234bac26be937e448d94efd6d37ee2f3cdbaa2def3c8e74c2afb2b9a
|
|
BLAKE2b-256 checksum How to use checksums |
ea893c3ebe3190ee00222a34588ac0383702f0d91ebb2983408cf906c0236671
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |