jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 131 forks source link

Make django-image-cropping compatible with non-default file-storage #71

Closed dominicrodger closed 9 years ago

dominicrodger commented 9 years ago

Previously, using ManifestStaticFilesStorage with django- image-cropping wouldn't work, because the path to the file was hard-coded. This change cribs from django.contrib.admin for manipulating the path to the static file before handing it off to Django forms. Arguably, it'd be nice if this is something Django handled for us, but until it does, we need to do this work ourselves.

For Django versions earlier than 1.7, we don't change behaviour, since figuring out whether the staticfiles app is installed is hard without django.apps.

dominicrodger commented 9 years ago

Hmmm... not sure those build failures are related to my changes. Any ideas here @jonasundderwolf?

dominicrodger commented 9 years ago

FYI - I started a discussion on django-developers about this - feels like something Django should support more directly.

anrie commented 9 years ago

Hey Dominic,

thanks for the PR!

The broken tests seem unrelated to me: They look more like a Selenium/Travis CI issues. But I see that i get them fixed sometime soon so we have a clear baseline and can be sure that your changes can be safely merged.

dominicrodger commented 9 years ago

@anrie - that seems a reasonable approach to me. I'll have a go at updating the PR today or tomorrow.

dominicrodger commented 9 years ago

Does that look better @anrie? Your suggestion has the advantage of improved Django support too - since the static template tag goes back to at least Django 1.4.

anrie commented 9 years ago

Looks good to me and is merged!