Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Forms Inlines and Media Inline Model Formset

Inline formsets with image cropping using jquery plugin

I have a Product Model and an Image Model that has a foreign key to the Product, it is similar with the example in the video(multiple images,drag and drop and remove link).

But instead of a simple CharField I have an ImageField.

The user adds one or multiple images to the product. The Users can add different images as ratio, dimensions so behind we need to process the image.

I take a look for this on the workshop "Image Manipulation with python", but if I resize/crop the image automatically can look bad, so I want to offer to the user the possibility to see and select what to crop thru jquery, with a plugin like (http://www.croppic.net/) . It is not important the plugin, but I want to have the possibility to zoom and move left, right.

I found the package django-image-cropping but you cannot move left-right or zoom and the plugin(jquery part) is old. I also checked django-imagekit, sorl-thumbnail, django-versatileimagefield but they are missing the interaction of the user on cropping.

So I thought to try something myself, to get the data from the jquery rectangle-canvas after the user submitted and sent to django to do the crop.

Unfortunately I couldn't do it yet, so maybe someone has some suggestions, snippets how to do it.

Maybe with or without Django Rest Framework.