Friday, May 13, 2011

Django flickr api encoding issue

I was having trouble with Django rendering some pages with templates that worked with most other pages. I dug into the issue, and saw a DjangoUnicodeDecodeError exception, from encoding.py, line 88.

Turns out that Django expects UTF-8 encoding by default, while the results that I was getting with the flickr api were ISO-8859-1 encoded (being that its targeted to the web), and the Django rendering engine was having a cow with that.

The fix was simple, but not one that I am really happy with. I changed the templates/__init__.py for my Django installation to call:

value = force_unicode(value,encoding='iso-8859-1')

in the _render_value_in_context() function.

Not the best way to solve the problem, so I am open to any suggestions on better ways to do this.

In my defense:
- I tried looking for somewhere in the Django settings where I would set the default encoding to ISO-8859, but could not find anything
- I was pressed for time, didnt want to go down a cleaner implementation that did not touch the base Django install


Monday, March 7, 2011

Week 9 of 2011

Every once in a while the top photos of the week scream out a theme. This week, the flickrverse was clearly enamored with the Geneva Auto Show.


From the time the Murci raced the Veyron on Top Gear Season 13, episode 2, been waiting to see the replacement. Lamborghini unveiled the Aventador at Geneva, and definitely a worthy successor - a 60 HP bump to 700 horses!  Cant wait to see the face off between the Aventador and the Veyron!

Getting back to photos - looks like we have the year's first dandelion photo! Looking forward to many more as the weather heats up in the northern hemisphere!

 My favorite for the week was this beautiful silhouette of the Great Egret - its just such a great capture of a stunningly beautiful creature!

Until the next time - keep clicking!

Monday, November 15, 2010

Week 45 of 2010 - New Top Camera

The Canon EOS 5D Mk II has replaced the Nikon D70/D70s as the top camera ever! Check out the latest line up here.

The new Nikon D7000 also entered the flickstr camera pages during week 44.

Week 45 of 2010

flickstr was down for the past few weeks. That was the combined result of me doing an unintended Django upgrade to the server, and not having the time to go back and fix the application to work with the latest version.

Back online now...

[Technical sidenote]

Updated the server to Python 2.6, and ended up updating Django to v1.2.3. Unintentionally.

There are a number of changes that need to be made to an application that was running on Django v0.95 to catch up with 4 years of framework development. A summary:

1. Needed to copy in the new settings.py for the application
2. Update the settings.py - notably, a different format for specifying the database, and an additional field to define - TEMPATE_DIRS
3. Update the model imports - previous version was case insensitive - v1.2.3 is not
4. Update template file names - v0.95 assumed a '.html' suffix - need to specify that explicitly in v1.2.3. Also need up update the 'extends' within the templates to have the '.html' suffix

[/Technical sidenote]

Tuesday, September 14, 2010

Week 35 of 2010

Top honors this week again going to .I Travel East. My favorite amongst the photos is the one with the dude against the huge sky.
.I Travel East has been consistently in the Top 20 for the past few weeks - looking at the All Time Greats, looks like .I Travel East has moved up to the 13th spot, right after Imapix! Congratulations!!

Special mention this week goes out to Cate, who brings us visions of ancient Greece, with the post processing capturing the essence of antiquity perfectly.
The texture and overlays are exceptional, and the painstaking masking of certain features in the images really makes them pop!

To compensate for the desaturated images that seem quite popular, we have JoeyRamone with an explosion of color.

Great assortment of photos in the Top 20 this week as usual. Until next week - keep snapping!

Week 34 of 2010 - Tomato!

Top honors this week go to .I Travel East with some great photos that emphasize a subdued palette and minimalist composition.

The interesting meme for this week comes from flydime, who brings us images from Buñol in the Valencia region of Spain. Apparently the town-folk get rid of tons of over-ripe tomatoes by having the biggest baddest food fight of them all! 

Its a great photo stream. All the while looking through it, the only thought in my mind was about the poor sod that would have to clean up after this mess! Bet the walls take a beating, and most laundry detergent advertisements have me convinced about the treacherous nature of tomato stains!

Thursday, July 29, 2010

Week 29 of 2010

Two great stories to highlight from this weeks Top 20!

But first, looks like the stoic Storm Troopers from Balakov are now being challenged by the flamboyant dolls from Picklepud!





Now the stories!

First up - a fantastic photo montage of an F18 crashing and burning at the Alberta International Airshow from sloppyshooter. The pilot being able to safely eject out of the plane transformed what could have been an extremely tragic story into one that is every pyromaniac's $50 million fireworks fantasy!





More photos from the media about the crash are here.



Next up - a story as endearing as the imagery of Forrest Gump running down the road, and tons of people following the messiah - each deriving their own personal meaning. This time around, Forrest Gump is Hobo Matt, he has a camera (a Motorola Droid, none the less), and the millions following his story are doing it via his blog (please do pop open another window and look at the blog - you dont know what you are missing!). Hobo Matt is walking his way across the USA, from Rockaway Beach, NY to Rockaway Beach, OR. He is more than half way across - posting from Great Falls, MT for this past week. The photos capture all those moments where you saw something incredible, zipping past at 70 mph, just wishing that you could head back and stop for a bit. As Matt puts it - "Moving through the world at three miles an hour, you can fully take in your surroundings".








Although not in this week's Top 20, the photo that totally moves me is Willy's family. Meager earthly possessions, but smiles and hearts so big that all the world's possessions look small and petty.


Until next time - Keep on clicking!!