django 1.5+ compatibility
python 3 compatibility