mirror of
https://github.com/django/django.git
synced 2025-10-30 17:16:10 +00:00
Fixed #21674 -- Deprecated the import_by_path() function in favor of import_string().
Thanks Aymeric Augustin for the suggestion and review.
This commit is contained in:
committed by
Tim Graham
parent
fcc21837dc
commit
5d263dee30
@@ -6,7 +6,7 @@ from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.files.storage import default_storage, Storage, FileSystemStorage
|
||||
from django.utils.functional import empty, LazyObject
|
||||
from django.utils.module_loading import import_by_path
|
||||
from django.utils.module_loading import import_string
|
||||
from django.utils._os import safe_join
|
||||
from django.utils import six, lru_cache
|
||||
|
||||
@@ -257,7 +257,7 @@ def get_finder(import_path):
|
||||
Imports the staticfiles finder class described by import_path, where
|
||||
import_path is the full Python path to the class.
|
||||
"""
|
||||
Finder = import_by_path(import_path)
|
||||
Finder = import_string(import_path)
|
||||
if not issubclass(Finder, BaseFinder):
|
||||
raise ImproperlyConfigured('Finder "%s" is not a subclass of "%s"' %
|
||||
(Finder, BaseFinder))
|
||||
|
||||
Reference in New Issue
Block a user