jQuery Resize And Crop (jrac): visually resize an image and place a crop
Project description
Requirements
Django 1.3 or later
Installation
$ pip install django-jquery
Setup
Add 'django.contrib.staticfiles', 'jquery', 'jquery_ui', and 'jrac' to INSTALLED_APPS in your settings.py:
INSTALLED_APPS = (
# ...
'django.contrib.staticfiles',
'jquery',
'jquery_ui'
'jrac',
# ...
)
Make sure you use 'collectstatic' to copy installed files to your static folder:
$ python setup.py collectstatic
Refer to Django static files documentation for additional information.
Usage
You can refer to jquery in your template with:
{{ STATIC_URL }}js/jquery.jrac.js
Custom widget:
class MyWidget(forms.TextInput):
class Media:
js = ('js/jquery.jrac.js',)
def render(self, name, value, attrs=None):
html = super(MyWidget, self).render(name, value, attrs=attrs)
# ...
return html
Deployment:
Use the minified jquery.jrac.min.js instead of jquery.jrac.js
Demo
Check out the demo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-jrac-1.0.2.dev10.tar.gz
(18.3 kB
view details)
File details
Details for the file django-jrac-1.0.2.dev10.tar.gz.
File metadata
- Download URL: django-jrac-1.0.2.dev10.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e391d45a26399ba3a5bc4eecd7a5f702e5e7c76f7286d514004f85a8a5974459
|
|
| MD5 |
aa1ea449a987cb39941bfd9390e20649
|
|
| BLAKE2b-256 |
1b9aa565de03f8b8e664644bf7f01782f51771875231ef35b0425c6863f6f1e3
|