Tag Archives: django

The perfect crop using PIL

I’ve always wanted to display good looking thumbnail pictures with each thumbnail having the same width and height (dimension). Using some calculations, cropping and resizing, I was able to create thumbnails cropped from center and scaled down to my width/height … Continue reading

Posted in Python | Tagged , , , , | 4 Comments

Django – creating timezone aware datetime objects

After developing some codes for few hours, when I finally tried to test it, I am greeted with this timezone related error. After reviewing Django docs, it is clearly stated that it has full support for timezones and that it … Continue reading

Posted in Python | Tagged , , | Leave a comment

Django – verbose console logging in development server

The moment you set DEBUG = False in development server for Django, you will be clueless about what’s going on for every error your application may encounter. If you just want to show verbose error messages on the console (when … Continue reading

Posted in Python | Tagged , , , | 1 Comment