Archive for May, 2009

Safe truncation of HTML

posted on May 1st, 2009 by Greg Allard in Greg's Comments on the Internet

This is useful. I just tried it with this

test = " go to http://ole-laursen.blogspot.com/2009/05/safe-truncation-of-html.html "

{{test|urlize|truncatehtml:25}}

And it worked how expected.

Read more comments by Greg Allard

Quick Thumbnails in Django

posted on May 1st, 2009 by Greg Allard in Greg's Comments on the Internet

I updated this post. I was thinking the uploaded file was deleted after using it, but I just needed to reset the file. Django’s InMemoryUploadedFile uses StringIO. Doing file.seek(0)
will reset the StringIO file to be ready to create another thumbnail.

Read more comments by Greg Allard