Skip to content

Commit

Permalink
Merge pull request #17 from derenio/use_python_importlib
Browse files Browse the repository at this point in the history
Fix "RemovedInDjango19Warning: django.utils.importlib ..." warning
  • Loading branch information
respondcreate committed Jul 9, 2015
2 parents 67dbd61 + 0a33da0 commit 6f93032
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion versatileimagefield/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,13 @@ def autodiscover():

import copy
from django.conf import settings
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
# Django 1.7 drops support for Python 2.6 and deprecates its port of the
# "importlib" module which is available in Python 2.7.
try:
from importlib import import_module
except ImportError: # pragma: no cover
from django.utils.importlib import import_module

for app in settings.INSTALLED_APPS:
mod = import_module(app)
Expand Down

0 comments on commit 6f93032

Please sign in to comment.