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

Uploaded Source

Built Distribution

django_jquery-2.2.4-py2.py3-none-any.whl (33.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-jquery-2.2.4.tar.gz
Algorithm Hash digest
SHA256 8616d1a1d948321ffce06b7c27af0a8914074b1559ad8e7152a4be6d061cecd0
MD5 95410cbac0663e2b4944f66612d4c9a6
BLAKE2b-256 7b89f3dfba37847083e7fbd33fe08ce21906d96721d91358f826795fa73b29f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_jquery-2.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4b58e67b54f903cd72dbcfe19accf251925bdc204537b04078d6be3ef10ab513
MD5 8a4560d4e7c68b493243582d19004355
BLAKE2b-256 dea96fa37634880d9799ad5f94d1f2e7118f17bf05edfcd9d687f433d71d1b14

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