MCPcopy
hub / github.com/django/django / get_finder

Function get_finder

django/contrib/staticfiles/finders.py:305–315  ·  view source on GitHub ↗

Import the staticfiles finder class described by import_path, where import_path is the full Python path to the class.

(import_path)

Source from the content-addressed store, hash-verified

303
304@functools.cache
305def get_finder(import_path):
306 """
307 Import the staticfiles finder class described by import_path, where
308 import_path is the full Python path to the class.
309 """
310 Finder = import_string(import_path)
311 if not issubclass(Finder, BaseFinder):
312 raise ImproperlyConfigured(
313 'Finder "%s" is not a subclass of "%s"' % (Finder, BaseFinder)
314 )
315 return Finder()

Callers 3

get_findersFunction · 0.85

Calls 2

import_stringFunction · 0.90

Tested by 2