[1.7.x] Removed usage of deprecated django.utils.importlib.

Backport of 1e84d261d6 from master