Upgrading to Django 1.6

Date Tags Django

Django 1.6 came out recently, which was soon followed by 1.6.1, and it looks like 1.6.2 is on the way. I finally got around to upgrading two of my largest sites. I thought I would make a list of what I changed at a high level for my own reference. Perhaps someone else may find it useful as well.

View comments.

more ...

Haystack Search Quoting Issue

I use the awesome Haystack search framework for my Django powered website. I have found Haystack to be a huge win. It is easy to setup, configure, and customize when you have to. As someone who doesn't know very much about the world of searching, I'm grateful to have a powerful tool that just works without me having to get too involved in arcane details.

View comments.

more ...



Finding empty directories in Python

Date Tags Python

Late one night I needed to write some Python code to recursively find empty directories. Searching online produced some unsatisfactory solutions. Here is a simple solution that leverages os.walk.

import os

empty_dirs = []
for root, dirs, files in os.walk(starting_path):
   if not len(dirs) and not len(files):
       empty_dirs ...

View comments.

more ...


A C & Python chained assignment gotcha

Date Tags Python / C++

Late last night I had a marathon debugging session where I discovered I had been burned by not fully understanding chaining assignment statements in Python. I was porting some C code to Python that had some chained assignment expressions. C and C++ programmers are well used to this idiom which ...

View comments.

more ...