Monday, 9 September 2013

how to load image in the size specified in django template?

how to load image in the size specified in django template?

Suppose, I have 20 images of size 1600 X 900 in a page. How do I load the
images in the size that I specify on a template? In the css I can do it.
But I want to change the actual size of the image, so that when clicked on
the particular image, it will load the original image with its original
size. Is there any way that I can do it? I tried using easy_thumbnails and
it was great, until it gave me problems when I deployed it using the
apache server. Any help will be deeply appreciated. Thank you!
EDIT:
.html:
{% for Status in status %}
<p class="user">{{ Status.creator.get_full_name }}</p>
{% if Status.image %}
<div class="image_image">
<center>
<img src="{{ MEDIA_URL }}{{Status.image}}" width=300px />
</center>
</div>
<p class="status_image">{{Status}}</p>
<span class="clear"></span>
<hr>
{% else %}
<p class="status_status">{{Status}}</p>
<span class="clear_right"></span>
<hr>
{% endif %}
{% endfor %}

No comments:

Post a Comment