Closed Shakarim closed 9 years ago
Hello everybody, i installed and configured package into my application, but it's doesn't work. I hope you can help me. Thanks.
from image_cropping import ImageRatioField, ImageCropField from django.db import models from django.contrib.auth.models import User class UserInfo(models.Model): ... user = models.OneToOneField(User, related_name='user', verbose_name='User Info', primary_key=True) photo = ImageCropField(upload_to=upload_to, verbose_name='Аватар', null=True) photo_cropping = ImageRatioField('photo', '100x100') ...
from image_cropping import ImageCroppingMixin from .models import UserInfo class UserAdmin(ImageCroppingMixin, UserAdmin): ...
from cabinet.models import UserInfo class UserInfoForm(forms.ModelForm): class Meta: model = UserInfo fields = ('photo', 'photo_cropping')
{% load cropping thumbnail %} <img style="width: 100%;" src="{% thumbnail request.user.user.photo 100x100 box=request.user.user.photo_cropping crop detail %}" alt="User avatar"/>
INSTALLED_APPS = ( ... 'image_cropping', 'easy_thumbnails', ) ... from easy_thumbnails.conf import Settings as Thumbnail_settings THUMBNAIL_PROCESSORS = ( 'image_cropping.thumbnail_processors.crop_corners', ) + Thumbnail_settings.THUMBNAIL_PROCESSORS
Without exceptions, without errors, just doesn't work...
Hello everybody, i installed and configured package into my application, but it's doesn't work. I hope you can help me. Thanks.
models.py
admin.py
forms.py
in html
settings.py
Without exceptions, without errors, just doesn't work...