haven't touched this in a while, couple changes to get it up to speed with the newest version of Django 1.5