Closed xXPhenomXx closed 10 years ago
Hello,
I've followed along with the tutorial and am unable to get the cropper to load with my application.
I have added easy_thumbnails and image_cropping to my settings.py along with THUMBNAIL_PROCESSOR snippet provided in the setup
My environment:
pytz==2012d
django==1.6.4 django-shop==0.2.0 jsonfield==0.9.20 south==0.8.4 django-reversion==1.8.0 django-wysiwyg==0.5.1 django-tinymce==1.5.2 django-image-cropping==0.8.2
django-memcached==0.1.2
django-cms==3.0.1 django-classy-tags==0.5.1 django-mptt==0.6.0 django-sekizai==0.7 html5lib==0.999 djangocms-admin-style==0.2.2 djangocms-text-ckeditor==2.1.4 djangocms-snippet==1.0.2 djangocms-style==1.3 djangocms-link==1.3.4 djangocms-file==0.0.1 djangocms-flash==0.0.2 djangocms-googlemap==0.0.5 djangocms-picture==0.0.2 cmsplugin-htmlsitemap==0.1.3 djangocms-video==0.0.1 djangocms-teaser==0.0.1 djangocms-stacks==0.2.3 Django-Select2==4.2.2
djangorestframework==2.3.12 markdown==2.3.1 django-filter==0.7 django-picklefield
django-s3-folder-storage==0.2
sorl-thumbnail==11.12 easy_thumbnails==1.4 Pillow==2.4.0 django-filer==0.9.4 cmsplugin-filer==0.9.5 django-fancy-autocomplete==0.1a1 imagestore==2.7.6 cmsplugin_gallery==0.5.5 django-tagging==0.3.2 six==1.6.1
haystack==0.15 django-haystack==1.2.7
from django.db import models from image_cropping import ImageRatioField import uuid import os.path
def generate_filename(instance, filename): f, ext = os.path.splitext(filename) return 'images/case_studies/' + '%s%s' % (uuid.uuid4().hex, ext)
def generate_filename2(instance, filename): f, ext = os.path.splitext(filename) return 'images/case_studies/filmstrip/' + '%s%s' % (uuid.uuid4().hex, ext)
class CaseStudy(models.Model): title = models.CharField(max_length=50, blank=False) short_description = models.CharField(max_length=255) long_description = models.TextField(blank=True) image = models.ImageField(blank=True, null=True, upload_to=generate_filename) cropping = ImageRatioField('image', '575x385', size_warning=True, allow_fullsize=True) date_added = models.DateTimeField(blank=False, auto_now_add=True) date_updated = models.DateTimeField(auto_now_add=True) class Meta: db_table = 'case_study' verbose_name = 'Case Study' verbose_name_plural = 'Case Studies'
from django.contrib import admin from .models import ImageSlider as Image from image_cropping import ImageCroppingMixin
class CaseStudyAdmin(ImageCroppingMixin, admin.ModelAdmin): pass
admin.site.register(CaseStudy, CaseStudyAdmin)
Any help would be appreciated on what I might be doing wrong???
You seem to be using Grappelli or another Admin skin. Can't really do support for those, sorry. You might want to look at the JavaScript console to see if any errors are being shown.
Hello,
I've followed along with the tutorial and am unable to get the cropper to load with my application.
I have added easy_thumbnails and image_cropping to my settings.py along with THUMBNAIL_PROCESSOR snippet provided in the setup
My environment:
PYTHON PACKAGES
pytz==2012d
DJANGO
django==1.6.4 django-shop==0.2.0 jsonfield==0.9.20 south==0.8.4 django-reversion==1.8.0 django-wysiwyg==0.5.1 django-tinymce==1.5.2 django-image-cropping==0.8.2
CACHING
django-memcached==0.1.2
DJANGO CMS DEPENDENCIES
django-cms==3.0.1 django-classy-tags==0.5.1 django-mptt==0.6.0 django-sekizai==0.7 html5lib==0.999 djangocms-admin-style==0.2.2 djangocms-text-ckeditor==2.1.4 djangocms-snippet==1.0.2 djangocms-style==1.3 djangocms-link==1.3.4 djangocms-file==0.0.1 djangocms-flash==0.0.2 djangocms-googlemap==0.0.5 djangocms-picture==0.0.2 cmsplugin-htmlsitemap==0.1.3 djangocms-video==0.0.1 djangocms-teaser==0.0.1 djangocms-stacks==0.2.3 Django-Select2==4.2.2
DJANGO REST
djangorestframework==2.3.12 markdown==2.3.1 django-filter==0.7 django-picklefield
AMAZON S3 STORAGE
django-s3-folder-storage==0.2
IMAGE HANDLING
sorl-thumbnail==11.12 easy_thumbnails==1.4 Pillow==2.4.0 django-filer==0.9.4 cmsplugin-filer==0.9.5 django-fancy-autocomplete==0.1a1 imagestore==2.7.6 cmsplugin_gallery==0.5.5 django-tagging==0.3.2 six==1.6.1
SEARCH
haystack==0.15 django-haystack==1.2.7
My Models.py:
from django.db import models from image_cropping import ImageRatioField import uuid import os.path
def generate_filename(instance, filename): f, ext = os.path.splitext(filename) return 'images/case_studies/' + '%s%s' % (uuid.uuid4().hex, ext)
def generate_filename2(instance, filename): f, ext = os.path.splitext(filename) return 'images/case_studies/filmstrip/' + '%s%s' % (uuid.uuid4().hex, ext)
class CaseStudy(models.Model): title = models.CharField(max_length=50, blank=False) short_description = models.CharField(max_length=255) long_description = models.TextField(blank=True) image = models.ImageField(blank=True, null=True, upload_to=generate_filename) cropping = ImageRatioField('image', '575x385', size_warning=True, allow_fullsize=True) date_added = models.DateTimeField(blank=False, auto_now_add=True) date_updated = models.DateTimeField(auto_now_add=True) class Meta: db_table = 'case_study' verbose_name = 'Case Study' verbose_name_plural = 'Case Studies'
My Admin.py
from django.contrib import admin from .models import ImageSlider as Image from image_cropping import ImageCroppingMixin
class CaseStudyAdmin(ImageCroppingMixin, admin.ModelAdmin): pass
admin.site.register(CaseStudy, CaseStudyAdmin)
Any help would be appreciated on what I might be doing wrong???