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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-jquery-1.8.2.tar.gz
Algorithm Hash digest
SHA256 dc8a9b0d7176783184b7bb223d84a8547e62b4e26ad92d23bbf80bf917c48baf
MD5 ce5e2c93ae9db64a8629d29b3b519740
BLAKE2b-256 65eb2446eba3e161302e8eedbab3c93abf6a83e674a43abe0991669da8fbaaae

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