added code for pre-django1.7 detection