updated for django 1.6 and apache > 2.4