django-form-utils icon indicating copy to clipboard operation
django-form-utils copied to clipboard

ImageWidget and Amazon S3

Open danielbraun opened this issue 12 years ago • 6 comments
trafficstars

So, the two don't play together when you don't use utilize any thumbnail generator. The reason is that instead of invoking the ImageField's url method, it performs a "manual" join between the project's media folder and the image path - and that simply doesn't work with remote storages such as Amazon's.

I have forked and fixed it for myself, and would like to send a pull request, but I have can't figure out how to run the tests - for some reason they are in the egg, but not in the app itself...

How do I run the tests?

danielbraun avatar Jun 05 '13 19:06 danielbraun

python setup.py test will run the tests using your current environment (requires that you have Django installed, and probably PIL too if you want the ImageWidget tests to run). Alternatively, you can run tox (if you "pip install tox") and it will run the tests against a variety of Python and Django versions (it may have some errors if you don't have all the requisite Python versions available).

I should really have a CONTRIBUTING doc...

carljm avatar Jun 05 '13 19:06 carljm

Thanks - I've just figured and out and came to respond, and you had already replied (that was quick!)... I'll prepare a pull request.

danielbraun avatar Jun 05 '13 19:06 danielbraun

Apparently, once PIL is installed, all tests pass. Is it safe to post a pull request?

danielbraun avatar Jun 05 '13 20:06 danielbraun

sure! ideally your pull request would also add a new test for the thing it is fixing, but I can take a look, it might be ok to merge without that if it passes existing tests.

carljm avatar Jun 05 '13 20:06 carljm

Hey, been using this in another project (using S3 again), and it seems to be working well. Seeing the S3-hosted-image. Closing.

danielbraun avatar Nov 30 '14 13:11 danielbraun

Correction: Still not solved.

danielbraun avatar Nov 30 '14 13:11 danielbraun