diff --git a/django/contrib/gis/geometry/backend/__init__.py b/django/contrib/gis/geometry/backend/__init__.py index d9f30bb256..52fa0dedd4 100644 --- a/django/contrib/gis/geometry/backend/__init__.py +++ b/django/contrib/gis/geometry/backend/__init__.py @@ -5,7 +5,7 @@ from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: - module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend') + module = import_module('django.contrib.gis.geometry.backend.%s' % geom_backend) except ImportError: try: module = import_module(geom_backend) diff --git a/django/db/models/loading.py b/django/db/models/loading.py index 40aa983c25..bb87728a5c 100644 --- a/django/db/models/loading.py +++ b/django/db/models/loading.py @@ -96,7 +96,7 @@ class AppCache(object): self.nesting_level += 1 app_module = import_module(app_name) try: - models = import_module('.models', app_name) + models = import_module('%s.models' % app_name) except ImportError: self.nesting_level -= 1 # If the app doesn't have a models module, we can just ignore the diff --git a/django/db/utils.py b/django/db/utils.py index 4afc592e64..eb5708ccf6 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -110,7 +110,7 @@ class DatabaseErrorWrapper(object): def load_backend(backend_name): # Look for a fully qualified database backend name try: - return import_module('.base', backend_name) + return import_module('%s.base' % backend_name) except ImportError as e_user: # The database backend wasn't found. Display a helpful error message # listing all possible (built-in) database backends. diff --git a/django/utils/formats.py b/django/utils/formats.py index cc66149026..dbe1716639 100644 --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -54,7 +54,7 @@ def iter_format_modules(lang): for location in format_locations: for loc in locales: try: - yield import_module('.formats', location % loc) + yield import_module('%s.formats' % (location % loc)) except ImportError: pass