Closed gabe-dol closed 8 years ago
Are you including the 'cropping' area in your form? The plugin does not change the upload field (as i thought to begin with), you have to add the cropping field to your template.
I am having the same issue here, I noticed that my {{ form.media }} is not rendering to anything. I have tried using the ImageCropWidget on both ImageCropField and ImageRatioField. @lomholdt Can you elaborate your solution?
So I added the widget to my moddel as such:
logo = models.ImageField(blank=True, null=True, upload_to=logo_path)
cropping_logo = ImageRatioField('logo', '200x200', size_warning=True)
In my template i add the form media at the top with {{ form.media }}, and I add the image field and cropping field like this:
{{ form.logo }}
{{ form.cropping_logo }}
When I do this, It works :) Did you remember to add the 'image_cropping' and 'easy_thumbnails' apps to the INSTALLED_APPS in settings.py?
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
...
'image_cropping',
'easy_thumbnails',
]
@lomholdt what is in your forms.py? Also you include {% load cropping %} and {% load easy_thumbnails %} in your template right? This is what I get when I try what u did
Clearly not the right stuff haha
I only include {% load cropping %} because I am only using the {% cropped thumbnail ... %} tag. In my form I have
class MyEditForm(forms.ModelForm):
class Meta:
model = ModelName
fields = ['name',
'email',
...
'logo',
'cropping_logo',
]
widgets = {
'logo': ImageCropWidget,
}
@lomholdt Yeah IDK what exactly is causing my issue. I'm on on python 3.4, django 1.8. Currently I am just using a profile pic that doesnt crop, but re-sizes the uploaded image, and it seems to work fine. thanks
I do everything as the doc says. Then I do {{ form.media }} in the head and {{ form }} in the body. The file upload works just fine, but the user cannot see the image in order to crop it! How do i fix this?