Closed joannadal closed 9 years ago
Can you send your model definition? How did you define the ImageRatioField
? Just using the ImageCropWidget
is not enough, please refer to the documentation on how to integrate.
This is the model.py:
class UserProfile(AbstractBaseUser, PermissionsMixin): class Meta: app_label = 'main'
image = ImageCropField(upload_to=get_file_path_user_photo, null=True, blank=True)
profile_image = ImageRatioField('image', '200x200')
I am trying to put the image into the form page, but I can't.
I am using this code:
forms.py:
from image_cropping import ImageCropWidget
class UserEditForm(forms.ModelForm):
html file:
{{ form.media }} {{ form.image }}