Please Support Them

A couple of friends of mine are cycling across America – 3500 miles in 30 Days! – to raise money for 3 Cancer charities – Please help them…

I feel that I have I winged a bit today. I don’t want to sound like a moaner, I am just trying to get a cross that this really is a challenge in so many ways. In fact, the cycling is probably the easy bit. This has been far tougher than I had imagined.

I do realise that what I am going through is nothing compared to what someone fighting cancer goes through. And maybe that is just another reason why today has been emotional. Realising, why I am here and why I am doing this.

CycleAcrossAmerica2010.com

Lightweight Django Thumbnails

I needed a good thumbnail solution for a recent Django project but didn’t want the overhead of using sorl – I just needed a simple template tag that would let me generate the correct size of thumbnail from the main picture.

I found a solution on djangosnippets.org but it needed a little tweeking to suit my needs.

The filter is applied directly to an image field using a template tag such as

{{ object.image|make_thumbnail:'100x200' }}

and supposing the image filename is “image.jpg”, it checks if there is a file called “image_100x200.jpg”, if the file isn’t there, it resizes and saves the original image, finally it returns the proper url to the resized image.

The updated filter is given below (you will need PIL installed):
Read the rest of this entry…

Nginx & Django on Webfaction – Part 3

Now that we have a stable and resilient environment (See Part 1a, Part 1b, and Part 2) I’m going to show you how we can hand off some of the work of file uploads to nginx and even get a nice upload progress bar into the bargain :)
Take a deep breath as this is quite a long one…. :)
Read the rest of this entry…

Switch to our mobile site