ImportError instead of NameError for Django < 1.7