Fix checks for Django versions earlier than 1.7