# django-croppie **Repository Path**: winegame/django-croppie ## Basic Information - **Project Name**: django-croppie - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-09 - **Last Updated**: 2022-05-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Django Croppie Django-croppie is an application for easy integration [croppie.js](https://github.com/Foliotek/Croppie) image cropper to django projects. # Installation 1. Install with `pip install django-croppie` 2. Add `croppie` to `INSTALLED_APPS`: ``` INSTALLED_APPS = [ ... 'croppie', ... ] ``` # Usage 1. To use django-croppie you should specify a form field: ``` from croppie.fields import CroppieField class AddForm(forms.Form): photo = CroppieField() ``` Also `CroppieField` takes non required argument `options` - a python dictionary that represent `croppie.js` settings. For example: ``` photo = CroppieField( options={ 'viewport': { 'width': 120, 'height': 140, }, 'boundary': { 'width': 200, 'height': 220, }, 'showZoomer': True, }, ) ``` 2. Add form static files to template: ``` {% block js %} {{ form.media }} {% endblock js %} ``` 3. Specify position of cropper widget on page: ```