Skip to main content

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


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-3.1.0.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

django_jquery-3.1.0-py2.py3-none-any.whl (33.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-jquery-3.1.0.tar.gz.

File metadata

File hashes

Hashes for django-jquery-3.1.0.tar.gz
Algorithm Hash digest
SHA256 414ac1083708ac71cc771612e7287702c939d06cd357fd53bb1271a4f6255115
MD5 272ccb56255e57c2b7b8f35ac6799ec3
BLAKE2b-256 76bebc377f2d9406f9e2e0b483fc69df04fe5a7780802b42fb64b8f2a9cc52e0

See more details on using hashes here.

File details

Details for the file django_jquery-3.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_jquery-3.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e7e2ac14234bac26be937e448d94efd6d37ee2f3cdbaa2def3c8e74c2afb2b9a
MD5 185c1f068945092d2dd8daa3d5942f6e
BLAKE2b-256 ea893c3ebe3190ee00222a34588ac0383702f0d91ebb2983408cf906c0236671

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page