Socket
Socket
Sign inDemoInstall

django-jquery

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-jquery

jQuery packaged in an handy django app to speed up new applications and deployment.


Maintainers
2

Django jQuery

Requirements

Django <https://www.djangoproject.com/>_ 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 <https://docs.djangoproject.com/en/dev/howto/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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc