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

Uploaded Source

Built Distribution

django_jquery-1.12.4-py2.py3-none-any.whl (37.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-jquery-1.12.4.tar.gz
Algorithm Hash digest
SHA256 8bd883113fba5269231e21bd2aee1f35b20b139e01c829a8e707050e086a3fe3
MD5 7fadd73006396a71f8e14e4b02c80967
BLAKE2b-256 29fe791581c8b0af3ecc732997fcaea4991ebc632b08faf64f2417f85b86142c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_jquery-1.12.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0cac9e40de9da132edff6567789eccb9ba70fbde52e97305669c2fe4d4ac84c6
MD5 f3b2d6310925be96ffc2cdcc6987c856
BLAKE2b-256 2b596c1d05f28dded8f3256d903949ba4b19b8e4cb20a7f6ed4e2bd4414f7f9c

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