jonasundderwolf / django-image-cropping

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

Accessing Image via non-admin, non-form view. #87

Closed TrueNorthTrent closed 8 years ago

TrueNorthTrent commented 8 years ago

Can someone point me in the right direction for accessing a thumbnail from a non-admin view?

I'm currently using a render_to_response view for generating a dashboard view and have my members images being defined by:

 {% for user in userList %}
<img style="{{user.userImage}}">
{% endfor %}

The code you guys have linked is telling me that I don't have an instance of Members opened. I'm just trying to export the correct image url for the cropped images which are currently working in the admin form.

Thanks for any help.

anrie commented 8 years ago

To display the cropped thumbnail in your template you have to use the template tag: https://github.com/jonasundderwolf/django-image-cropping#frontend

The example app also showcases some options: https://github.com/jonasundderwolf/django-image-cropping/blob/master/example/templates/modelform_example.html