Skip to main content

Django form widget for cropping uploaded images based on a predefined size

Project description

DjangoKeyhole is a Django addon that adds an image crop widget to the standard ImageField. The actual cropping is done by the wonderful jquery cropping library cropit. Now the implementation destroys the original image but future versions might support non-destructive cropping.

  • quick and easy instalation

  • no external dependencyes

  • magic.

Installation

$ pip install DjangoKeyhole

Add keyhole to you’re INSTALLED_APPS in settings.py

Last but not least

$ python manage.py collectstatic

How to use

from django import forms

#import the widget
from keyhole.widgets import CroppedImageWidget

class MyAdminForm(forms.ModelForm):
    # width and height are in px
    foo_image = forms.ImageField(widget=CroppedImageWidget(width=160, height=160))

Todo’s

  • Write Tests

  • Fix typos in text

  • Add Code Comments

  • Test in pyhon 2.7

Version

0.1

License

MIT

Free Software, Hell Yeah!

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

DjangoKeyhole-0.81.dev0.tar.gz (11.2 kB view details)

Uploaded Source

File details

Details for the file DjangoKeyhole-0.81.dev0.tar.gz.

File metadata

File hashes

Hashes for DjangoKeyhole-0.81.dev0.tar.gz
Algorithm Hash digest
SHA256 98abd667839781454b2052fec868012e4b22c5f967bd07114c57f4ea063338e4
MD5 8268c6464f473632b2982e63717f1f89
BLAKE2b-256 309f6ae83fb392060c26008f4bbeab0bb096cd5eae98897c4926f352f503ce15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page